mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
apt: warn users on auto-install dep (#47704)
* apt: warn users on auto-install dep * add changelog
This commit is contained in:
committed by
Martin Krizek
parent
8ede4c5e60
commit
58238375b4
3
changelogs/fragments/47704-apt-warn-auto-intall.yml
Normal file
3
changelogs/fragments/47704-apt-warn-auto-intall.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
bugfixes:
|
||||
- apt - Show a warning hint in case apt auto-installs its dependecies.
|
||||
@@ -933,6 +933,7 @@ def main():
|
||||
module.fail_json(msg="%s must be installed to use check mode. "
|
||||
"If run normally this module can auto-install it." % PYTHON_APT)
|
||||
try:
|
||||
module.warn("Updating cache and auto-installing missing dependency: %s" % PYTHON_APT)
|
||||
module.run_command(['apt-get', 'update'], check_rc=True)
|
||||
module.run_command(['apt-get', 'install', '--no-install-recommends', PYTHON_APT, '-y', '-q'], check_rc=True)
|
||||
global apt, apt_pkg
|
||||
|
||||
Reference in New Issue
Block a user