Add 'package' alias and support for list type for pacman 'name' parameter

reviewable/pr18780/r1
Indrajit Raychaudhuri 9 years ago
parent 3c8c716801
commit 25b85dafbb

@ -251,12 +251,13 @@ def check_packages(module, pacman_path, packages, state):
def main(): def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec = dict( argument_spec = dict(
name = dict(aliases=['pkg']), name = dict(aliases=['pkg', 'package'], type='list'),
state = dict(default='present', choices=['present', 'installed', "latest", 'absent', 'removed']), state = dict(default='present', choices=['present', 'installed', "latest", 'absent', 'removed']),
recurse = dict(default=False, type='bool'), recurse = dict(default=False, type='bool'),
force = dict(default=False, type='bool'), force = dict(default=False, type='bool'),
upgrade = dict(default=False, type='bool'), upgrade = dict(default=False, type='bool'),
update_cache = dict(default=False, aliases=['update-cache'], type='bool')), update_cache = dict(default=False, aliases=['update-cache'], type='bool')
),
required_one_of = [['name', 'update_cache', 'upgrade']], required_one_of = [['name', 'update_cache', 'upgrade']],
supports_check_mode = True) supports_check_mode = True)
@ -285,7 +286,7 @@ def main():
upgrade(module, pacman_path) upgrade(module, pacman_path)
if p['name']: if p['name']:
pkgs = p['name'].split(',') pkgs = p['name']
pkg_files = [] pkg_files = []
for i, pkg in enumerate(pkgs): for i, pkg in enumerate(pkgs):

Loading…
Cancel
Save