mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 18:50:04 -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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user