From 7417282d37ed6f32f4277659f592b2fee6bdc2e2 Mon Sep 17 00:00:00 2001 From: Strahinja Kustudic Date: Fri, 6 Oct 2017 00:16:11 +0200 Subject: [PATCH] Do not run systemctl daemon-reload in check mode --- lib/ansible/modules/system/systemd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/systemd.py b/lib/ansible/modules/system/systemd.py index 67301f1ca9..6b4bd780f8 100644 --- a/lib/ansible/modules/system/systemd.py +++ b/lib/ansible/modules/system/systemd.py @@ -322,7 +322,7 @@ def main(): module.fail_json(msg="name is also required when specifying %s" % requires) # Run daemon-reload first, if requested - if module.params['daemon_reload']: + if module.params['daemon_reload'] and not module.check_mode: (rc, out, err) = module.run_command("%s daemon-reload" % (systemctl)) if rc != 0: module.fail_json(msg='failure %d during daemon-reload: %s' % (rc, err))