]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
common/tasks/rhel-entitlements.yml: regenerate machine-id 740/head
authorDan Mick <dmick@redhat.com>
Tue, 16 May 2023 01:38:17 +0000 (18:38 -0700)
committerDan Mick <dmick@redhat.com>
Tue, 27 Jun 2023 20:40:02 +0000 (13:40 -0700)
We can't leave /etc/machine-id blank; it breaks things, one of
which is the kernel install, which runs a postinstall script to update
/boot/loader/entries, which does nothing (silently) if there's
nothing in /etc/machine-id.  Since it can come from the dbus id,
and does by default, and there's a command to generate the dbus
id, generate both, dbus first.  This fixes the kernel postinstall.
I don't know if there should be any correlation between
machine-id and the subscription-manager/katello IDs.

Signed-off-by: Dan Mick <dmick@redhat.com>
roles/common/tasks/rhel-entitlements.yml

index bfeb2267a09229fa6e33ddd0b559d84173039652..477587b35f3fcbea32e3b3a252b4786081823ecd 100644 (file)
   register: new_uuid
   when: use_satellite == true
 
+- name: Run dbus-uuidgen to create /var/lib/dbus/machine-id
+  shell: dbus-uuidgen --ensure
+
+- name: Run systemd-machine-id-setup to set /etc/machine-id
+  shell: systemd-machine-id-setup
+
 - name: Add new UUID to dmi_system_uuid.facts
   ansible.builtin.lineinfile:
     path: /etc/rhsm/facts/dmi_system_uuid.facts
   retries: 5
   delay: 10
 
+# recreate the removed machine-id files to avoid breaking
+# other parts of the system, /bin/install-kernel for instance
+
+- name: Run dbus-uuidgen to create /var/lib/dbus/machine-id
+  shell: dbus-uuidgen --ensure
+
+- name: Run systemd-machine-id-setup to set /etc/machine-id
+  shell: systemd-machine-id-setup
+
 - name: Remove old apt-mirror repository definition.
   file:
     path: /etc/yum.repos.d/cd.repo