From 8a3c60cfd270827f8c6cad3a945bfdb27006a8df Mon Sep 17 00:00:00 2001 From: "t.goto" Date: Tue, 15 Mar 2016 16:19:08 +0900 Subject: [PATCH] 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. --- lib/ansible/modules/extras/monitoring/zabbix_host.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/modules/extras/monitoring/zabbix_host.py b/lib/ansible/modules/extras/monitoring/zabbix_host.py index 0b48d6bc955..bfc339786f5 100644 --- a/lib/ansible/modules/extras/monitoring/zabbix_host.py +++ b/lib/ansible/modules/extras/monitoring/zabbix_host.py @@ -485,6 +485,10 @@ def main(): else: module.exit_json(changed=False) 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 if proxy: proxy_id = host.get_proxyid_by_proxy_name(proxy)