diff --git a/tasks/main.yml b/tasks/main.yml index f78f8a1..5cd0ee2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -69,6 +69,7 @@ name: "{{ item.name }}" state: "{{ item.state }}" persistent: "{{ item.persistent | default('no') }}" + ignore_selinux_state: "{{ ansible_selinux.status == 'disabled' }}" with_items: "{{ selinux_booleans }}" - name: Set SELinux file contexts @@ -79,6 +80,7 @@ state: "{{ item.state | default('present') }}" selevel: "{{ item.selevel | default(omit) }}" seuser: "{{ item.seuser | default(omit) }}" + ignore_selinux_state: "{{ ansible_selinux.status == 'disabled' }}" with_items: "{{ selinux_fcontexts }}" - name: Restore SELinux labels on filesystem tree @@ -102,6 +104,7 @@ setype: "{{ item.setype }}" state: "{{ item.state | default('present') }}" local: "{{ item.local | default(False) }}" + ignore_selinux_state: "{{ ansible_selinux.status == 'disabled' }}" with_items: "{{ selinux_ports }}" - name: Set linux user to SELinux user mapping @@ -111,6 +114,7 @@ serange: "{{ item.serange | default('s0') }}" state: "{{ item.state | default('present') }}" reload: "{{ item.reload | default(False) }}" + ignore_selinux_state: "{{ ansible_selinux.status == 'disabled' }}" with_items: "{{ selinux_logins }}" notify: __selinux_reload_policy