You've already forked role-check-mk-agent
Add protocol fror host-management
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
---
|
||||
cmk_add_host: false # Should be true/false whether we should automatically add host for monitoring.
|
||||
cmk_omd_protocol: http # Should be http or https
|
||||
cmk_omd_host: your-checkmk-hostname
|
||||
cmk_omd_site: your-checkmk-site # e.g the first piece after the / following your hostname
|
||||
# If you have created a folder in WATO already you want hosts to be put in when registered
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- name: add host to omd
|
||||
uri:
|
||||
method: POST
|
||||
url: "http://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=add_host{{ cmk_auth }}"
|
||||
url: "{{ cmk_omd_protocol }}://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=add_host{{ cmk_auth }}"
|
||||
body: |
|
||||
request={
|
||||
"attributes": {
|
||||
@@ -25,14 +25,10 @@
|
||||
output: "{{ res.content | from_json }}"
|
||||
when: cmk_add_host
|
||||
|
||||
# - debug:
|
||||
# msg: "{{ output }}"
|
||||
# when: cmk_add_host
|
||||
|
||||
- name: cmk_discovery
|
||||
uri:
|
||||
method: POST
|
||||
url: http://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=discover_services&mode=refresh{{ cmk_auth }}
|
||||
url: "{{ cmk_omd_protocol }}://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=discover_services&mode=refresh{{ cmk_auth }}"
|
||||
body: 'request={"hostname":"{{ inventory_hostname }}"}'
|
||||
body_format: raw
|
||||
status_code: 200
|
||||
@@ -43,7 +39,7 @@
|
||||
- name: cmk_apply
|
||||
uri:
|
||||
method: POST
|
||||
url: http://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=activate_changes&mode=specific{{ cmk_auth }}
|
||||
url: "{{ cmk_omd_protocol }}://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=activate_changes&mode=specific{{ cmk_auth }}"
|
||||
body: 'request={"sites":["{{ cmk_omd_site }}"]}'
|
||||
body_format: raw
|
||||
status_code: 200
|
||||
|
||||
Reference in New Issue
Block a user