mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 08:37:21 +00:00
add host to project folder when failing resort to root folder
This commit is contained in:
1 parent
1c4b349434
commit
b82db1424e
1 file changed
+28
-15
@@ -11,20 +11,34 @@
|
||||
file: ../vars/checkmk.yml
|
||||
|
||||
- name: Add proxy host into checkMK
|
||||
checkmk.general.host:
|
||||
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
||||
site: "{{ checkmk_agent_site }}"
|
||||
validate_certs: "true"
|
||||
automation_user: "{{ checkmk_agent_user }}"
|
||||
automation_secret: "{{ checkmk_password }}"
|
||||
folder: "/"
|
||||
name: "{{ inventory_hostname }}"
|
||||
attributes:
|
||||
ipaddress: "{{ hostvars[inventory_hostname].ansible_host }}"
|
||||
tag_Variant: "proxy"
|
||||
tag_project_zone: "{{ project_zone }}"
|
||||
state: "present"
|
||||
notify: "activate changes"
|
||||
block:
|
||||
- name: Add {{ inventory_hostname }} to "/{{ os_project }}-{{ win_project }}" CheckMK
|
||||
checkmk.general.host:
|
||||
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
||||
site: "{{ checkmk_agent_site }}"
|
||||
validate_certs: "true"
|
||||
automation_user: "{{ checkmk_agent_user }}"
|
||||
automation_secret: "{{ checkmk_password }}"
|
||||
folder: "/{{ os_project }}-{{ win_project }}"
|
||||
name: "{{ inventory_hostname }}"
|
||||
attributes:
|
||||
ipaddress: "{{ hostvars[inventory_hostname].ansible_host }}"
|
||||
state: "present"
|
||||
notify: "activate changes"
|
||||
rescue:
|
||||
- name: Add {{ inventory_hostname }} to "/" CheckMK
|
||||
checkmk.general.host:
|
||||
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
||||
site: "{{ checkmk_agent_site }}"
|
||||
validate_certs: "true"
|
||||
automation_user: "{{ checkmk_agent_user }}"
|
||||
automation_secret: "{{ checkmk_password }}"
|
||||
folder: "/"
|
||||
name: "{{ inventory_hostname }}"
|
||||
attributes:
|
||||
ipaddress: "{{ hostvars[inventory_hostname].ansible_host }}"
|
||||
state: "present"
|
||||
notify: "activate changes"
|
||||
|
||||
- name: Install CheckMK Agent
|
||||
import_role:
|
||||
@@ -34,4 +48,3 @@
|
||||
- name: register agent for TLS
|
||||
shell: |
|
||||
cmk-agent-ctl register --hostname {{ inventory_hostname }} --server {{ checkmk_server }} --site {{ checkmk_agent_site }} --user {{ checkmk_agent_user }} --password '{{ checkmk_password }}' --trust-cert
|
||||
|
||||
Reference in new issue
Block a user