From 6b34dc788a5ad58d33906aa078ff534a028d9afa Mon Sep 17 00:00:00 2001 From: Sebastien Boyron Date: Tue, 26 Sep 2017 22:22:55 +0200 Subject: [PATCH] [feat] module apt: add warning on deprecated states --- lib/ansible/modules/packaging/os/apt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/apt.py b/lib/ansible/modules/packaging/os/apt.py index 9467c9cd283..0e012214ca4 100644 --- a/lib/ansible/modules/packaging/os/apt.py +++ b/lib/ansible/modules/packaging/os/apt.py @@ -919,7 +919,7 @@ def main(): use_apt_get = p['force_apt_get'] if not use_apt_get and not APTITUDE_CMD and p.get('upgrade', None) in ['full', 'safe', 'yes']: - module.warn("Could not find aptitude. Using apt-get instead") + module.warn("Could not find aptitude. Using apt-get instead.") use_apt_get = True updated_cache = False @@ -932,8 +932,10 @@ def main(): # Deal with deprecated aliases if p['state'] == 'installed': + module.deprecate("State 'installed' is deprecated. Using state 'present' instead.", version=2.8) p['state'] = 'present' if p['state'] == 'removed': + module.deprecate("State 'removed' is deprecated. Using state 'absent' instead.", version=2.8) p['state'] = 'absent' # Get the cache object