Sfoglia il codice sorgente

add playbook to remove ssh key from all servers

SiM 4 anni fa
parent
commit
86a00c5531
1 ha cambiato i file con 17 aggiunte e 0 eliminazioni
  1. 17 0
      playbooks/remove-ssh-key.yml

+ 17 - 0
playbooks/remove-ssh-key.yml

@@ -0,0 +1,17 @@
+# Supprimer une clé ssh sur tous les serveurs
+---
+- hosts: tera-host:tera-dev:tera-prod
+  tasks:
+     - name: Remove authorized key taken from file
+       authorized_key:
+         user: root
+         state: absent
+         key: "{{ lookup('file', '/tmp/rm_id_rsa.pub') }}"
+
+- hosts: tera-dev-agora:tera-prod-agora
+  tasks:
+     - name: Remove authorized key taken from file
+       authorized_key:
+         user: admin
+         state: absent
+         key: "{{ lookup('file', '/tmp/rm_id_rsa.pub') }}"