|
|
@ -102,7 +102,8 @@ class Facts(object):
|
|
|
|
'/etc/vmware-release': 'VMwareESX',
|
|
|
|
'/etc/vmware-release': 'VMwareESX',
|
|
|
|
'/etc/openwrt_release': 'OpenWrt',
|
|
|
|
'/etc/openwrt_release': 'OpenWrt',
|
|
|
|
'/etc/system-release': 'OtherLinux',
|
|
|
|
'/etc/system-release': 'OtherLinux',
|
|
|
|
'/etc/alpine-release': 'Alpine' }
|
|
|
|
'/etc/alpine-release': 'Alpine',
|
|
|
|
|
|
|
|
'/etc/release': 'Solaris' }
|
|
|
|
SELINUX_MODE_DICT = { 1: 'enforcing', 0: 'permissive', -1: 'disabled' }
|
|
|
|
SELINUX_MODE_DICT = { 1: 'enforcing', 0: 'permissive', -1: 'disabled' }
|
|
|
|
|
|
|
|
|
|
|
|
# A list of dicts. If there is a platform with more than one
|
|
|
|
# A list of dicts. If there is a platform with more than one
|
|
|
@ -135,7 +136,7 @@ class Facts(object):
|
|
|
|
return self.facts
|
|
|
|
return self.facts
|
|
|
|
|
|
|
|
|
|
|
|
# Platform
|
|
|
|
# Platform
|
|
|
|
# patform.system() can be Linux, Darwin, Java, or Windows
|
|
|
|
# platform.system() can be Linux, Darwin, Java, or Windows
|
|
|
|
def get_platform_facts(self):
|
|
|
|
def get_platform_facts(self):
|
|
|
|
self.facts['system'] = platform.system()
|
|
|
|
self.facts['system'] = platform.system()
|
|
|
|
self.facts['kernel'] = platform.release()
|
|
|
|
self.facts['kernel'] = platform.release()
|
|
|
@ -235,6 +236,15 @@ class Facts(object):
|
|
|
|
data = get_file_content(path)
|
|
|
|
data = get_file_content(path)
|
|
|
|
self.facts['distribution'] = 'Alpine'
|
|
|
|
self.facts['distribution'] = 'Alpine'
|
|
|
|
self.facts['distribution_version'] = data
|
|
|
|
self.facts['distribution_version'] = data
|
|
|
|
|
|
|
|
elif name == 'Solaris':
|
|
|
|
|
|
|
|
data = get_file_content(path).split('\n')[0]
|
|
|
|
|
|
|
|
if 'Oracle Solaris' in data:
|
|
|
|
|
|
|
|
data = " ".join(data.split()[1:None])
|
|
|
|
|
|
|
|
self.facts['distribution'] = data.split()[0]
|
|
|
|
|
|
|
|
self.facts['distribution_version'] = data.split()[1]
|
|
|
|
|
|
|
|
distribution_release = " ".join(data.split()[2:None])
|
|
|
|
|
|
|
|
if distribution_release != 'X86' and distribution_release != 'SPARC':
|
|
|
|
|
|
|
|
self.facts['distribution_release'] = distribution_release
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.facts['distribution'] = name
|
|
|
|
self.facts['distribution'] = name
|
|
|
|
|
|
|
|
|
|
|
|