Merge pull request #729 from marktheunissen/fix-apt
Fixes for apt module
This commit is contained in:
commit
61780e0980
1 changed files with 16 additions and 16 deletions
|
@ -138,13 +138,13 @@ def main():
|
||||||
# reopen cache w/ modified config
|
# reopen cache w/ modified config
|
||||||
cache.open(progress=None)
|
cache.open(progress=None)
|
||||||
|
|
||||||
if modules.boolean(p['update_cache'])
|
if module.boolean(p['update_cache']):
|
||||||
cache.update()
|
cache.update()
|
||||||
cache.open(progress=None)
|
cache.open(progress=None)
|
||||||
if p['package'] == None:
|
if p['package'] == None:
|
||||||
module.exit_json(changed=False)
|
module.exit_json(changed=False)
|
||||||
|
|
||||||
force_yes = modules.boolean(p['force'])
|
force_yes = module.boolean(p['force'])
|
||||||
|
|
||||||
if p['package'].count('=') > 1:
|
if p['package'].count('=') > 1:
|
||||||
module.fail_json(msg='invalid package spec')
|
module.fail_json(msg='invalid package spec')
|
||||||
|
@ -161,7 +161,7 @@ def main():
|
||||||
install(module, p['package'], cache, default_release=p['default_release'],
|
install(module, p['package'], cache, default_release=p['default_release'],
|
||||||
install_recommends=install_recommends,force=force_yes)
|
install_recommends=install_recommends,force=force_yes)
|
||||||
elif p['state'] == 'removed':
|
elif p['state'] == 'removed':
|
||||||
remove(module, p['package'], cache, purge = modules.boolean(p['purge']))
|
remove(module, p['package'], cache, purge = module.boolean(p['purge']))
|
||||||
|
|
||||||
# this is magic, see lib/ansible/module_common.py
|
# this is magic, see lib/ansible/module_common.py
|
||||||
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
||||||
|
|
Loading…
Reference in a new issue