mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07: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'):
|
||||
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)
|
||||
|
||||
# Run daemon-reload first, if requested
|
||||
|
@ -303,6 +303,7 @@ def main():
|
|||
if rc != 0:
|
||||
module.fail_json(msg='failure %d during daemon-reload: %s' % (rc, err))
|
||||
|
||||
if unit:
|
||||
found = False
|
||||
is_initd = sysv_exists(unit)
|
||||
is_systemd = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue