mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add a fact about apparmor, to see if that's loaded or not
This commit is contained in:
parent
5bbab91452
commit
0847a137d3
1 changed files with 8 additions and 0 deletions
|
@ -175,6 +175,7 @@ class Facts(object):
|
|||
self.get_cmdline()
|
||||
self.get_public_ssh_host_keys()
|
||||
self.get_selinux_facts()
|
||||
self.get_apparmor_facts()
|
||||
self.get_caps_facts()
|
||||
self.get_fips_facts()
|
||||
self.get_pkg_mgr_facts()
|
||||
|
@ -468,6 +469,13 @@ class Facts(object):
|
|||
except (AttributeError,OSError):
|
||||
self.facts['selinux']['type'] = 'unknown'
|
||||
|
||||
def get_apparmor_facts(self):
|
||||
self.facts['apparmor'] = {}
|
||||
if os.path.exists('/sys/kernel/security/apparmor'):
|
||||
self.facts['apparmor']['status'] = 'enabled'
|
||||
else:
|
||||
self.facts['apparmor']['status'] = 'disabled'
|
||||
|
||||
def get_caps_facts(self):
|
||||
capsh_path = self.module.get_bin_path('capsh')
|
||||
if capsh_path:
|
||||
|
|
Loading…
Reference in a new issue