Change-Id: Idfbcfa8e9fc157c691ea30ebc5b6235ac4c3b436 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
24 lines
731 B
YAML
24 lines
731 B
YAML
---
|
|
- name: Get stat of libvirtd apparmor profile
|
|
ansible.builtin.stat:
|
|
path: /etc/apparmor.d/usr.sbin.libvirtd
|
|
register: apparmor_libvirtd_profile
|
|
|
|
- name: Get stat of libvirtd apparmor disable profile
|
|
ansible.builtin.stat:
|
|
path: /etc/apparmor.d/disable/usr.sbin.libvirtd
|
|
register: apparmor_libvirtd_disable_profile
|
|
|
|
- name: Remove apparmor profile for libvirt
|
|
ansible.builtin.shell:
|
|
cmd: |
|
|
apparmor_parser -v -R /etc/apparmor.d/usr.sbin.libvirtd && \
|
|
ln -vsf /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable
|
|
args:
|
|
executable: /bin/bash
|
|
become: true
|
|
changed_when: true
|
|
when:
|
|
- apparmor_libvirtd_profile.stat.exists
|
|
- not apparmor_libvirtd_disable_profile.stat.exists
|