Update register of host

This commit is contained in:
2022-08-09 07:42:02 +12:00
parent 3d39f3e231
commit 342fec8955
5 changed files with 83 additions and 23 deletions

View File

@@ -29,20 +29,6 @@
when: cmk_add_host
tags: cmk_register
- name: cmk_discovery
uri:
method: POST
url: "{{ cmk_omd_protocol }}://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=discover_services&mode=refresh{{ cmk_auth }}"
body: 'request={"hostname":"{{ instance_name | default(inventory_hostname) }}"}'
body_format: raw
status_code: 200
validate_certs: no
follow_redirects: yes
become: no
when: "cmk_add_host and output.result_code == 0"
delegate_to: localhost
tags: cmk_register
- name: cmk_apply
uri:
method: POST