Updating allowing for https://

This commit is contained in:
2021-05-07 11:00:14 +12:00
parent 08a725ed68
commit 5ed5818aff

View File

@@ -8,22 +8,26 @@
"attributes": {
"tag_criticality": "prod",
"tag_agent": "cmk-agent",
"ipaddress": "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
"ipaddress": "{{ ansible_host }}"
},
"folder": "{{ cmk_folder | default('Unsorted') }}",
"hostname": "{{ inventory_hostname }}"
}
body_format: raw
return_content: yes
validate_certs: no
follow_redirects: yes
register: res
become: no
delegate_to: localhost
when: cmk_add_host
tags: cmk_register
- name: Parse result
set_fact:
output: "{{ res.content | from_json }}"
when: cmk_add_host
tags: cmk_register
- name: cmk_discovery
uri:
@@ -32,9 +36,12 @@
body: 'request={"hostname":"{{ 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:
@@ -43,7 +50,10 @@
body: 'request={"sites":["{{ cmk_omd_site }}"]}'
body_format: raw
status_code: 200
validate_certs: no
follow_redirects: yes
become: no
run_once: true
when: "cmk_add_host and output.result_code == 0"
delegate_to: localhost
tags: cmk_register