From 2d5c2dabe83fae4511d29ea994e66e05da41b45e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Mon, 22 Sep 2014 18:54:00 +0200 Subject: [PATCH] Module alternatives: support check mode --- lib/ansible/modules/extras/system/alternatives.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/system/alternatives.py b/lib/ansible/modules/extras/system/alternatives.py index b80ffab944c..ce51ee860a9 100755 --- a/lib/ansible/modules/extras/system/alternatives.py +++ b/lib/ansible/modules/extras/system/alternatives.py @@ -62,7 +62,8 @@ def main(): name = dict(required=True), path = dict(required=True), link = dict(required=False), - ) + ), + supports_check_mode=True, ) params = module.params @@ -114,6 +115,8 @@ def main(): link = value if current_path != path: + if module.check_mode: + module.exit_json(changed=True, current_path=current_path) try: # install the requested path if necessary if path not in all_alternatives: