mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Refactor scan_packages for os detection
* Use setup facts ansible_os_family for os family detection now. Add support for Suse and it's ilk (which has a pretty ugly OS family implementation
This commit is contained in:
parent
d95470066c
commit
a1fbee4fa0
@ -4,6 +4,7 @@
|
||||
scan_use_recursive: false
|
||||
tasks:
|
||||
- scan_packages:
|
||||
os_family: '{{ ansible_os_family }}'
|
||||
- scan_services:
|
||||
- scan_files:
|
||||
paths: '{{ scan_file_paths }}'
|
||||
|
||||
@ -70,12 +70,12 @@ def deb_package_list():
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict())
|
||||
ans_dist = get_distribution().strip()
|
||||
if ans_dist in ('Centos', 'Centos linux', 'Red hat enterprise linux server', 'Amazon', 'Suse linux enterprise server', 'Opensuse'):
|
||||
os.system('echo "in rpm_package_list for %s" >> /tmp/foo' % ans_dist)
|
||||
argument_spec = dict(os_family=dict(required=True))
|
||||
)
|
||||
ans_os = module.params['os_family']
|
||||
if ans_os in ('RedHat', 'Suse', 'openSUSE Leap'):
|
||||
packages = rpm_package_list()
|
||||
elif ans_dist in ('Ubuntu', 'Debian'):
|
||||
elif ans_os == 'Debian':
|
||||
packages = deb_package_list()
|
||||
else:
|
||||
packages = None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user