mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 15:17:21 +00:00
Create initial downtime for new checkMK hosts
This commit is contained in:
1 parent
053928cf18
commit
3fadf1632e
1 file changed
+34
-15
@@ -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
|
||||
|
||||
Reference in new issue
Block a user