diff --git a/awx/playbooks/scan_facts.yml b/awx/playbooks/scan_facts.yml index 2c51c50709..1b90380c62 100644 --- a/awx/playbooks/scan_facts.yml +++ b/awx/playbooks/scan_facts.yml @@ -4,6 +4,7 @@ scan_use_recursive: false tasks: - scan_packages: + os_family: '{{ ansible_os_family }}' - scan_services: - scan_files: paths: '{{ scan_file_paths }}' diff --git a/awx/plugins/library/scan_packages.py b/awx/plugins/library/scan_packages.py index 3f9af5472c..9c47b0800f 100755 --- a/awx/plugins/library/scan_packages.py +++ b/awx/plugins/library/scan_packages.py @@ -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