mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 17:07:21 +00:00
rescue block for agent installation
This commit is contained in:
1 parent
1423931249
commit
882676ee04
1 file changed
+19
-17
@@ -123,25 +123,27 @@
|
||||
block:
|
||||
- name: Gather Facts
|
||||
setup:
|
||||
tags:
|
||||
- checkmk_all
|
||||
- checkmk_agent
|
||||
tags: checkmk_agent
|
||||
|
||||
- name: Install CheckMK agent on VMs
|
||||
import_role:
|
||||
name: agent
|
||||
tags:
|
||||
- checkmk_all
|
||||
- checkmk_agent
|
||||
tags: checkmk_agent
|
||||
|
||||
- name: TLS registrtion
|
||||
block:
|
||||
- name: register for TLS
|
||||
win_shell: |
|
||||
sl 'C:\Program Files (x86)\checkmk\service'
|
||||
.\cmk-agent-ctl register --hostname {{ inventory_hostname }} --server {{ checkmk_server }} --site {{ checkmk_agent_site }} --user {{ checkmk_agent_user }} --password '{{ checkmk_password }}' --trust-cert
|
||||
tags:
|
||||
- checkmk_host
|
||||
- checkmk_tls
|
||||
- checkmk_all
|
||||
|
||||
rescue:
|
||||
- name: restart agent service
|
||||
win_shell: |
|
||||
powershell Restart-Service -Name CheckmkService
|
||||
tags: always
|
||||
|
||||
- name: Retry agent installation
|
||||
import_role:
|
||||
name: agent
|
||||
tags: always
|
||||
|
||||
always:
|
||||
- name: register for TLS
|
||||
win_shell: |
|
||||
sl 'C:\Program Files (x86)\checkmk\service'
|
||||
.\cmk-agent-ctl register --hostname {{ inventory_hostname }} --server {{ checkmk_server }} --site {{ checkmk_agent_site }} --user {{ checkmk_agent_user }} --password '{{ checkmk_password }}' --trust-cert
|
||||
tags: [checkmk_all, checkmk_agent, checkmk_tls]
|
||||
Reference in new issue
Block a user