updated upgrade to a more sensible default as the previous was prone to confusion fixes #1667

pull/18777/head
Brian Coca 9 years ago committed by Matt Clay
parent 848e9de950
commit e7dc05df11

@ -80,8 +80,8 @@ options:
- 'Note: This does not upgrade a specific package, use state=latest for that.' - 'Note: This does not upgrade a specific package, use state=latest for that.'
version_added: "1.1" version_added: "1.1"
required: false required: false
default: "yes" default: "no"
choices: [ "yes", "safe", "full", "dist"] choices: [ "no", "yes", "safe", "full", "dist"]
dpkg_options: dpkg_options:
description: description:
- Add dpkg options to apt command. Defaults to '-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"' - Add dpkg options to apt command. Defaults to '-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"'
@ -548,7 +548,7 @@ def main():
default_release = dict(default=None, aliases=['default-release']), default_release = dict(default=None, aliases=['default-release']),
install_recommends = dict(default='yes', aliases=['install-recommends'], type='bool'), install_recommends = dict(default='yes', aliases=['install-recommends'], type='bool'),
force = dict(default='no', type='bool'), force = dict(default='no', type='bool'),
upgrade = dict(choices=['yes', 'safe', 'full', 'dist']), upgrade = dict(choices=['no', 'yes', 'safe', 'full', 'dist']),
dpkg_options = dict(default=DPKG_OPTIONS) dpkg_options = dict(default=DPKG_OPTIONS)
), ),
mutually_exclusive = [['package', 'upgrade', 'deb']], mutually_exclusive = [['package', 'upgrade', 'deb']],
@ -572,6 +572,10 @@ def main():
APT_GET_CMD = module.get_bin_path("apt-get") APT_GET_CMD = module.get_bin_path("apt-get")
p = module.params p = module.params
if p['upgrade'] == 'no':
p['upgrade'] = None
if not APTITUDE_CMD and p.get('upgrade', None) in [ 'full', 'safe', 'yes' ]: if not APTITUDE_CMD and p.get('upgrade', None) in [ 'full', 'safe', 'yes' ]:
module.fail_json(msg="Could not find aptitude. Please ensure it is installed.") module.fail_json(msg="Could not find aptitude. Please ensure it is installed.")

Loading…
Cancel
Save