mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-31 08:20:15 +00:00
rescue block for agent installation
This commit is contained in:
1 parent
1423931249
commit
882676ee04
1 file changed
+18
-16
@@ -123,25 +123,27 @@
|
|||||||
block:
|
block:
|
||||||
- name: Gather Facts
|
- name: Gather Facts
|
||||||
setup:
|
setup:
|
||||||
tags:
|
tags: checkmk_agent
|
||||||
- checkmk_all
|
|
||||||
- checkmk_agent
|
|
||||||
|
|
||||||
- name: Install CheckMK agent on VMs
|
- name: Install CheckMK agent on VMs
|
||||||
import_role:
|
import_role:
|
||||||
name: agent
|
name: agent
|
||||||
tags:
|
tags: checkmk_agent
|
||||||
- checkmk_all
|
|
||||||
- checkmk_agent
|
|
||||||
|
|
||||||
- name: TLS registrtion
|
rescue:
|
||||||
block:
|
- name: restart agent service
|
||||||
- name: register for TLS
|
win_shell: |
|
||||||
win_shell: |
|
powershell Restart-Service -Name CheckmkService
|
||||||
sl 'C:\Program Files (x86)\checkmk\service'
|
tags: always
|
||||||
.\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
|
|
||||||
|
|
||||||
|
- 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