mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 10:07: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
|
file: ../vars/checkmk.yml
|
||||||
|
|
||||||
- name: Add proxy host into checkMK
|
- name: Add proxy host into checkMK
|
||||||
checkmk.general.host:
|
block:
|
||||||
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
- name: Add {{ inventory_hostname }} to "/{{ os_project }}-{{ win_project }}" CheckMK
|
||||||
site: "{{ checkmk_agent_site }}"
|
checkmk.general.host:
|
||||||
validate_certs: "true"
|
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
||||||
automation_user: "{{ checkmk_agent_user }}"
|
site: "{{ checkmk_agent_site }}"
|
||||||
automation_secret: "{{ checkmk_password }}"
|
validate_certs: "true"
|
||||||
folder: "/"
|
automation_user: "{{ checkmk_agent_user }}"
|
||||||
name: "{{ inventory_hostname }}"
|
automation_secret: "{{ checkmk_password }}"
|
||||||
attributes:
|
folder: "/{{ os_project }}-{{ win_project }}"
|
||||||
ipaddress: "{{ hostvars[inventory_hostname].ansible_host }}"
|
name: "{{ inventory_hostname }}"
|
||||||
tag_Variant: "proxy"
|
attributes:
|
||||||
tag_project_zone: "{{ project_zone }}"
|
ipaddress: "{{ hostvars[inventory_hostname].ansible_host }}"
|
||||||
state: "present"
|
state: "present"
|
||||||
notify: "activate changes"
|
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
|
- name: Install CheckMK Agent
|
||||||
import_role:
|
import_role:
|
||||||
@@ -34,4 +48,3 @@
|
|||||||
- name: register agent for TLS
|
- name: register agent for TLS
|
||||||
shell: |
|
shell: |
|
||||||
cmk-agent-ctl register --hostname {{ inventory_hostname }} --server {{ checkmk_server }} --site {{ checkmk_agent_site }} --user {{ checkmk_agent_user }} --password '{{ checkmk_password }}' --trust-cert
|
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