瀏覽代碼

add playbook to remove ssh key from all servers

SiM 4 年之前
父節點
當前提交
86a00c5531
共有 1 個文件被更改,包括 17 次插入0 次删除
  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') }}"