Skip to content

Commit

Permalink
Merge branch '242-pglift-correction-echange-de-cle-ssh' into 'master'
Browse files Browse the repository at this point in the history
Resolve "pglift : correction échange de clé SSH"

Closes #242

See merge request formation/workshops!342
  • Loading branch information
arnobnq committed Jan 31, 2024
2 parents b55dfd0 + a92fc5a commit c94851f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fr/pglift/ansible/playbooks/roles/ssh-exchange/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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] }}"

0 comments on commit c94851f

Please sign in to comment.