Skip to content

Commit

Permalink
cluster_setup_add_livemigration_user: fix path to root's ssh keys
Browse files Browse the repository at this point in the history
On Yocto Kirkstone the root's home directory is /home/root not /root.
To avoid any issue we should use the ansible_env['HOME'] variable to get
the correct path to the root's home directory.

Signed-off-by: Mathieu Dupré <mathieu.dupre@savoirfairelinux.com>
  • Loading branch information
dupremathieu committed Oct 23, 2024
1 parent 0867c29 commit 9078eaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions playbooks/cluster_setup_add_livemigration_user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
group: "{{ livemigration_user }}"
- name: Fetch the root keyfile
fetch:
src: "/home/root/.ssh/id_rsa.pub"
src: "{{ ansible_env['HOME'] }}/.ssh/id_rsa.pub"
dest: "buffer/{{ inventory_hostname }}-id_rsa.pub"
flat: true
- name: Copy the key add to authorized_keys using Ansible module
Expand All @@ -59,7 +59,7 @@
flat: true
- name: populate the known_hosts files
known_hosts:
path: /home/root/.ssh/known_hosts
path: "{{ ansible_env['HOME'] }}/.ssh/known_hosts"
name: "{{ item }}"
key: "{{ item }} {{ lookup('file','buffer/' + item + '-ssh_host_ed25519_key.pub') }}"
with_items: "{{ groups['hypervisors'] }}"
Expand Down

0 comments on commit 9078eaf

Please sign in to comment.