Create initial downtime for new checkMK hosts

This commit is contained in:
abrown38 committed 2024-12-11 14:46:02 +00:00
1 parent 053928cf18
commit 3fadf1632e
1 file changed
+34 -15
+34 -15
View File
@@ -21,6 +21,7 @@
- checkmk_folder
- checkmk_host
- checkmk_all
- teardown
- name: Add Windows host into checkMK
checkmk.general.host:
@@ -42,21 +43,6 @@
- checkmk_host
- checkmk_all
- name: "Create folder for eidf project"
checkmk.general.folder:
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
site: "{{ checkmk_agent_site }}"
automation_user: "{{ checkmk_agent_user }}"
automation_secret: "{{ checkmk_password }}"
path: "/{{ os_project }}-{{ win_project }}"
name: "{{ os_project }}-{{ win_project }}"
state: "{{ state }}" # might need to create hosts them move so teardown works??? or leave folder after teardown or add only teardown task after
run_once: true
notify: "activate changes"
delegate_to: "localhost"
tags:
- teardown
- name: Move Proxy to project specific checkmk folder
checkmk.general.host:
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
@@ -73,6 +59,39 @@
when: project_zone == 'protected'
tags: checkmk_proxy
- name: Create downtimes for new VMs
block:
- name: "Schedule downtime on Windows VMs to cover deployment"
checkmk.general.downtime:
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
site: "{{ checkmk_agent_site }}"
automation_user: "{{ checkmk_agent_user }}"
automation_secret: "{{ checkmk_password }}"
host_name: "{{ inventory_hostname }}"
state: "{{ state }}" # might need to create hosts them move so teardown works??? or leave folder after teardown or add only teardown task after
start_after:
minutes: 0
end_after:
days: 0
hours: 3
delegate_to: "localhost"
- name: "Schedule downtime on Proxy"
checkmk.general.downtime:
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
site: "{{ checkmk_agent_site }}"
automation_user: "{{ checkmk_agent_user }}"
automation_secret: "{{ checkmk_password }}"
host_name: "{{ os_project }}-{{ win_project }}-proxy"
state: "{{ state }}" # might need to create hosts them move so teardown works??? or leave folder after teardown or add only teardown task after
start_after:
minutes: 0
end_after:
days: 0
hours: 3
delegate_to: "localhost"
tags: checkmk_downtime
handlers:
- name: "Activate Changes"
listen: activate changes