From a92fc5abcf344dd481d8dad06df9a5261ade68cd Mon Sep 17 00:00:00 2001 From: Arnaud Bruniquel Date: Wed, 31 Jan 2024 11:14:45 +0000 Subject: [PATCH] =?UTF-8?q?Resolve=20"pglift=20:=20correction=20=C3=A9chan?= =?UTF-8?q?ge=20de=20cl=C3=A9=20SSH"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fr/pglift/ansible/playbooks/roles/ssh-exchange/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr/pglift/ansible/playbooks/roles/ssh-exchange/tasks/main.yml b/fr/pglift/ansible/playbooks/roles/ssh-exchange/tasks/main.yml index b6f8c05..200999d 100644 --- a/fr/pglift/ansible/playbooks/roles/ssh-exchange/tasks/main.yml +++ b/fr/pglift/ansible/playbooks/roles/ssh-exchange/tasks/main.yml @@ -14,12 +14,12 @@ - name: Fetch the public key files fetch: src: "~{{ username }}/.ssh/id_rsa.pub" - dest: "/tmp/{{ansible_hostname}}-id_rsa.pub" + dest: "/tmp/{{inventory_hostname}}-id_rsa.pub" flat: yes - name: Add the keys to authorized_keys ansible.posix.authorized_key: user: "{{ username }}" key: "{{ lookup('file','/tmp/{{item}}-id_rsa.pub')}}" - when: "item != ansible_hostname" + when: "item != inventory_hostname" with_items: - "{{ groups[target_group] }}" \ No newline at end of file