Added check so that upgrade cannot be used with other options.
This commit is contained in:
parent
f1dffe9bc6
commit
fde27ae26e
1 changed files with 3 additions and 1 deletions
4
apt
4
apt
|
@ -69,7 +69,7 @@ options:
|
||||||
choices: [ "yes", "no" ]
|
choices: [ "yes", "no" ]
|
||||||
upgrade:
|
upgrade:
|
||||||
description:
|
description:
|
||||||
- If yes, performs an apt-get upgrade. If dist, performs an apt-get dist-upgrade.
|
- If yes, performs an apt-get upgrade. If dist, performs an apt-get dist-upgrade. 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: no
|
default: no
|
||||||
|
@ -230,6 +230,8 @@ def main():
|
||||||
|
|
||||||
if p['upgrade'] != 'no' and p['package'] is None:
|
if p['upgrade'] != 'no' and p['package'] is None:
|
||||||
upgrade(module, p['upgrade'])
|
upgrade(module, p['upgrade'])
|
||||||
|
elif p['upgrade'] != 'no' and p['package'] != None:
|
||||||
|
module.fail_json(msg="Upgrade should not be used in conjunction with other options.")
|
||||||
|
|
||||||
packages = p['package'].split(',')
|
packages = p['package'].split(',')
|
||||||
latest = p['state'] == 'latest'
|
latest = p['state'] == 'latest'
|
||||||
|
|
Loading…
Reference in a new issue