summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/system/systemd.py
diff options
context:
space:
mode:
authorStrahinja Kustudic <kustodian@gmail.com>2017-10-06 00:16:11 +0200
committerBrian Coca <bcoca@users.noreply.github.com>2017-10-05 18:40:02 -0400
commit7417282d37ed6f32f4277659f592b2fee6bdc2e2 (patch)
tree07688b1245354f8edf4647d01830136059f067be /lib/ansible/modules/system/systemd.py
parentfad3a4dc830f008bd740051919fbcdeebb3ddc0f (diff)
downloadansible-7417282d37ed6f32f4277659f592b2fee6bdc2e2.tar.gz
Do not run systemctl daemon-reload in check mode
Diffstat (limited to 'lib/ansible/modules/system/systemd.py')
-rw-r--r--lib/ansible/modules/system/systemd.py2
1 files changed, 1 insertions, 1 deletions
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))