mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
dont fail on missing service during check mode
This commit is contained in:
parent
255a5b5d75
commit
a715d03a83
1 changed files with 4 additions and 1 deletions
|
@ -47,4 +47,7 @@ def sysv_exists(name):
|
||||||
|
|
||||||
def fail_if_missing(module, found, service, msg=''):
|
def fail_if_missing(module, found, service, msg=''):
|
||||||
if not found:
|
if not found:
|
||||||
|
if module.check_mode:
|
||||||
|
module.exit_json(msg="Service %s not found on %s, assuming it will exist on full run" % (service, msg), changed=True)
|
||||||
|
else:
|
||||||
module.fail_json(msg='Could not find the requested service %s: %s' % (service, msg))
|
module.fail_json(msg='Could not find the requested service %s: %s' % (service, msg))
|
||||||
|
|
Loading…
Reference in a new issue