mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-29 20:26:51 +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_folder
|
||||||
- checkmk_host
|
- checkmk_host
|
||||||
- checkmk_all
|
- checkmk_all
|
||||||
|
- teardown
|
||||||
|
|
||||||
- name: Add Windows host into checkMK
|
- name: Add Windows host into checkMK
|
||||||
checkmk.general.host:
|
checkmk.general.host:
|
||||||
@@ -42,21 +43,6 @@
|
|||||||
- checkmk_host
|
- checkmk_host
|
||||||
- checkmk_all
|
- 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
|
- name: Move Proxy to project specific checkmk folder
|
||||||
checkmk.general.host:
|
checkmk.general.host:
|
||||||
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
||||||
@@ -73,6 +59,39 @@
|
|||||||
when: project_zone == 'protected'
|
when: project_zone == 'protected'
|
||||||
tags: checkmk_proxy
|
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:
|
handlers:
|
||||||
- name: "Activate Changes"
|
- name: "Activate Changes"
|
||||||
listen: activate changes
|
listen: activate changes
|
||||||
|
|||||||
Reference in new issue
Block a user