File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 pkg : apparmor-utils
55 state : latest
66 update_cache : yes
7- ignore_errors : true
7+ when : ansible_distribution != 'SUSE'
88
99- name : Enable Apparmor enforce mode
1010 shell : aa-enforce /etc/apparmor.d/*
11+ changed_when : false
1112
12- - name : Check Apparmor status
13+ - name : Check Apparmor status
1314 shell : aa-status
14- ignore_errors : true
15+ failed_when : false
16+ changed_when : false
Original file line number Diff line number Diff line change 11---
22
33- name : Get current SELinux mode
4- shell : getenforce || true
4+ command : getenforce
55 register : selinux_mode
6+ failed_when : false
7+ changed_when : false
68
7- - name : Set selinux to enforcing
8- command : setenforce enforcing
9+ - name : Set SELinux to enforcing
10+ command : setenforce Enforcing
911 changed_when : false
10- when : selinux_mode.stdout != "Enforcing"
12+ when :
13+ - selinux_mode.rc == 0
14+ - selinux_mode.stdout not in ['Enforcing', 'Disabled']
1115
12- - name : Ensure selinux is set permanently
13- selinux : policy=targeted state=enforcing
14- when : selinux_mode.stdout != "Enforcing"
16+ - name : Ensure SELinux is set permanently
17+ selinux :
18+ policy : targeted
19+ state : enforcing
20+ when :
21+ - selinux_mode.rc == 0
22+ - selinux_mode.stdout != 'Disabled'
1523
1624- name : Check SELinux status
17- shell : sestatus
18- ignore_errors : true
25+ command : sestatus
26+ failed_when : false
27+ changed_when : false
You can’t perform that action at this time.
0 commit comments