diff --git a/nova/core/roles/os_configuration/tasks/linux.yml b/nova/core/roles/os_configuration/tasks/linux.yml index ff685404..3b73f3d2 100644 --- a/nova/core/roles/os_configuration/tasks/linux.yml +++ b/nova/core/roles/os_configuration/tasks/linux.yml @@ -82,3 +82,5 @@ ansible.builtin.shell: "{{ lookup('template', 'regenerate-machine-id.sh') }}" args: executable: /bin/bash + register: regenerate_machine_id + changed_when: regenerate_machine_id.stdout != "done" diff --git a/nova/core/roles/os_configuration/templates/regenerate-machine-id.sh b/nova/core/roles/os_configuration/templates/regenerate-machine-id.sh index bfef3683..ba3a1180 100644 --- a/nova/core/roles/os_configuration/templates/regenerate-machine-id.sh +++ b/nova/core/roles/os_configuration/templates/regenerate-machine-id.sh @@ -19,6 +19,6 @@ if [[ -z $(grep -r {{ hostname }} /etc/ssh/) ]]; then else - echo "SSH host keys and machine-id already generated" + echo "done" fi \ No newline at end of file