Hello 

I need to clean up a bit the authorized keys files on our infra 
i created a simple palybook that goes and removed one key from the remote 
authorized_keys files but when I run it in check/diff mode i see it tried 
to remove far too many lines 


this is the playbook 

---
- hosts: all
  

  tasks; 

     - name: remove public keys 

       authorized_key:
          user: toto
          state: absent
          key: "{{ lookup('file', '/path/to/totpubkey.pub') }}"


I see absolutely no reason why in some hosts there are several public keys 
that are being removed for the authorized_keys files and since the module 
does not have a backup option is a bit of a problem. 

how could I use perhaps lineinfile to do the same? or how detect what is 
causing the module to delete several lines instead on just the one 
provided? 

thank you. 



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/35db046d-01df-4876-bc69-62e42a83d91d%40googlegroups.com.

Reply via email to