mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-02 12:14:25 -07:00
add exit_json
add exit_json code to succesfully exit, when you want to delete the already deleted host. Without this, playbook fails with `Specify at least one group for creating host` which is not correct message.
This commit is contained in:
parent
b03d1da393
commit
8a3c60cfd2
1 changed files with 4 additions and 0 deletions
|
@ -485,6 +485,10 @@ def main():
|
||||||
else:
|
else:
|
||||||
module.exit_json(changed=False)
|
module.exit_json(changed=False)
|
||||||
else:
|
else:
|
||||||
|
if state == "absent":
|
||||||
|
# the host is already deleted.
|
||||||
|
module.exit_json(changed=False)
|
||||||
|
|
||||||
# Use proxy specified, or set to 0 when adding new host
|
# Use proxy specified, or set to 0 when adding new host
|
||||||
if proxy:
|
if proxy:
|
||||||
proxy_id = host.get_proxyid_by_proxy_name(proxy)
|
proxy_id = host.get_proxyid_by_proxy_name(proxy)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue