From 01231575dab72a567dbfa1114f3138616a74cf88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Dupr=C3=A9?= Date: Mon, 14 Oct 2024 10:49:26 +0200 Subject: [PATCH 1/2] cluster_setup_add_livemigration_user: remove admincluster group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The livemigration_user should not be part of the admincluster group. Signed-off-by: Mathieu Dupré --- playbooks/cluster_setup_add_livemigration_user.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/cluster_setup_add_livemigration_user.yaml b/playbooks/cluster_setup_add_livemigration_user.yaml index 27c746b34..d32ebd9a3 100644 --- a/playbooks/cluster_setup_add_livemigration_user.yaml +++ b/playbooks/cluster_setup_add_livemigration_user.yaml @@ -17,7 +17,7 @@ name: "{{ livemigration_user }}" shell: /bin/sh system: true - groups: qemu,haclient,admincluster,libvirt + groups: qemu,haclient,libvirt create_home: false - name: Unlock the user replace: From fb18e7cffbc9fdd92e4a8102cb3607565edeefe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Dupr=C3=A9?= Date: Wed, 23 Oct 2024 13:57:37 +0200 Subject: [PATCH 2/2] cluster_setup_add_livemigration_user: fix path to root's ssh keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- playbooks/cluster_setup_add_livemigration_user.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/cluster_setup_add_livemigration_user.yaml b/playbooks/cluster_setup_add_livemigration_user.yaml index d32ebd9a3..23e4b7005 100644 --- a/playbooks/cluster_setup_add_livemigration_user.yaml +++ b/playbooks/cluster_setup_add_livemigration_user.yaml @@ -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 @@ -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'] }}"