diff --git a/ansible/roles/baremetal/tasks/post-install.yml b/ansible/roles/baremetal/tasks/post-install.yml index 5fdc471b0e..0f1b468974 100644 --- a/ansible/roles/baremetal/tasks/post-install.yml +++ b/ansible/roles/baremetal/tasks/post-install.yml @@ -152,12 +152,19 @@ register: apparmor_libvirtd_profile when: ansible_distribution == "Ubuntu" +- name: Get stat of libvirtd apparmor disable profile + stat: + path: /etc/apparmor.d/disable/usr.sbin.libvirtd + register: apparmor_libvirtd_disable_profile + when: ansible_distribution == "Ubuntu" + - name: Remove apparmor profile for libvirt command: apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd become: True when: - ansible_distribution == "Ubuntu" - apparmor_libvirtd_profile.stat.exists + - not apparmor_libvirtd_disable_profile.stat.exists - name: Get stat of chronyd apparmor profile stat: diff --git a/releasenotes/notes/fix-remove-libvirt-apparmor-disabled-profile-2cab584eec729b71.yaml b/releasenotes/notes/fix-remove-libvirt-apparmor-disabled-profile-2cab584eec729b71.yaml new file mode 100644 index 0000000000..0f2f517886 --- /dev/null +++ b/releasenotes/notes/fix-remove-libvirt-apparmor-disabled-profile-2cab584eec729b71.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue where the Libvirt AppArmor profile is disable and the + bootstrap-servers process tries to remove it. See `bug 1909874 + `__ for details.