소스 검색

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') }}"