diff --git a/changelogs/fragments/49881-fix-broken-urpmi-module.yaml b/changelogs/fragments/49881-fix-broken-urpmi-module.yaml new file mode 100644 index 00000000000..08a57eb63a3 --- /dev/null +++ b/changelogs/fragments/49881-fix-broken-urpmi-module.yaml @@ -0,0 +1,2 @@ +bugfixes: + - urpmi module - fixed issue #47154 can't install package with urpmi diff --git a/lib/ansible/modules/packaging/os/urpmi.py b/lib/ansible/modules/packaging/os/urpmi.py index f2ef0c6c4e8..41130bac30b 100644 --- a/lib/ansible/modules/packaging/os/urpmi.py +++ b/lib/ansible/modules/packaging/os/urpmi.py @@ -208,20 +208,14 @@ def main(): p = module.params - force_yes = p['force'] - no_recommends_yes = p['no_recommends'] - root = p['root'] - if p['update_cache']: update_package_db(module) - packages = p['package'] - if p['state'] in ['installed', 'present']: - install_packages(module, packages, root, force_yes, no_recommends_yes) + install_packages(module, p['name'], p['root'], p['force'], p['no_recommends']) elif p['state'] in ['removed', 'absent']: - remove_packages(module, packages, root) + remove_packages(module, p['name'], p['root']) if __name__ == '__main__':