Browse Source

add playbook to remove ssh key from all servers

SiM 4 years ago
parent
commit
86a00c5531
1 changed files with 17 additions and 0 deletions
  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') }}"