mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fixed code to actually check the parameter not key
also made rest conditional on unit being provided, previouslly it changed from being always required fixes #23810 alternate to #23907
This commit is contained in:
parent
cb13aea88b
commit
72a4e1cf0d
1 changed files with 127 additions and 126 deletions
|
@ -294,7 +294,7 @@ def main():
|
||||||
}
|
}
|
||||||
|
|
||||||
for requires in ('state', 'enabled', 'masked'):
|
for requires in ('state', 'enabled', 'masked'):
|
||||||
if requires is not None and unit is None:
|
if module.params[requires] is not None and unit is None:
|
||||||
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
|
||||||
|
@ -303,6 +303,7 @@ def main():
|
||||||
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))
|
||||||
|
|
||||||
|
if unit:
|
||||||
found = False
|
found = False
|
||||||
is_initd = sysv_exists(unit)
|
is_initd = sysv_exists(unit)
|
||||||
is_systemd = False
|
is_systemd = False
|
||||||
|
|
Loading…
Reference in a new issue