Initial Commit

This commit is contained in:
2020-10-13 16:33:32 +13:00
commit d646952ef5
23 changed files with 429 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
---
- name: Cleanup
hosts: localhost
gather_facts: false
become: no
vars:
cmk_rpm_agent: "{{ lookup('env', 'CMK_RPM_AGENT') }}"
cmk_omd_host: "{{ lookup('env', 'CMK_OMD_HOST') }}"
cmk_omd_site: "{{ lookup('env', 'CMK_OMD_SITE') }}"
cmk_username: "{{ lookup('env', 'CMK_USERNAME') }}"
cmk_secret: "{{ lookup('env', 'CMK_SECRET') }}"
cmk_auth: "&_username={{ cmk_username }}&_secret={{ cmk_secret }}"
tasks:
- name: Delete Host
uri:
method: POST
url: http://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=delete_host{{ cmk_auth }}
body: 'request={"hostname":"{{ item.name }}"}'
body_format: raw
status_code: 200
no_log: true
with_items: "{{ molecule_yml.platforms }}"
- 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 }}
body: 'request={"sites":["{{ cmk_omd_site }}"]}'
body_format: raw
status_code: 200