mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix prev feature commit, Do not require aptitude to use apt commands in the apt module, only needed when upgrading.
This commit is contained in:
parent
e3f213e030
commit
a35370a766
1 changed files with 4 additions and 2 deletions
|
@ -233,6 +233,8 @@ def upgrade(m, mode="yes", force=False):
|
|||
check_arg = '--simulate'
|
||||
else:
|
||||
check_arg = ''
|
||||
|
||||
apt_cmd = None
|
||||
if mode == "dist":
|
||||
# apt-get dist-upgrade
|
||||
apt_cmd = APT_GET_CMD
|
||||
|
@ -291,10 +293,10 @@ def main():
|
|||
global APT_GET_CMD
|
||||
APT_GET_CMD = module.get_bin_path("apt-get")
|
||||
|
||||
if not APTITUDE_CMD:
|
||||
p = module.params
|
||||
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.")
|
||||
|
||||
p = module.params
|
||||
install_recommends = p['install_recommends']
|
||||
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue