mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Do not run systemctl daemon-reload in check mode
This commit is contained in:
parent
fad3a4dc83
commit
7417282d37
1 changed files with 1 additions and 1 deletions
|
@ -322,7 +322,7 @@ def main():
|
||||||
module.fail_json(msg="name is also required when specifying %s" % requires)
|
module.fail_json(msg="name is also required when specifying %s" % requires)
|
||||||
|
|
||||||
# Run daemon-reload first, if requested
|
# 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))
|
(rc, out, err) = module.run_command("%s daemon-reload" % (systemctl))
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
module.fail_json(msg='failure %d during daemon-reload: %s' % (rc, err))
|
module.fail_json(msg='failure %d during daemon-reload: %s' % (rc, err))
|
||||||
|
|
Loading…
Reference in a new issue