You've already forked role-check-mk-agent
Initial Commit
This commit is contained in:
30
molecule/default/cleanup.yml
Normal file
30
molecule/default/cleanup.yml
Normal 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
|
||||
Reference in New Issue
Block a user