mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-31 00:30:15 +00:00
use ansible blocks with tags, also use standard layout
This commit is contained in:
1 parent
cba1130bd9
commit
a86a6ba964
2 files changed
+39
-54
No files matched your search
@@ -1,29 +1,15 @@
|
||||
---
|
||||
- name: Rebooting hosts
|
||||
ansible.windows.win_reboot:
|
||||
msg: "rebooting VM, initiated by ansible"
|
||||
reboot_timeout: 3600
|
||||
register: status
|
||||
- name: Reboot VM
|
||||
tags: reboot_vm
|
||||
block:
|
||||
- name: Rebooting hosts
|
||||
ansible.windows.win_reboot:
|
||||
msg: "rebooting VM, initiated by ansible"
|
||||
reboot_timeout: 3600
|
||||
|
||||
- name: Delay WinRM
|
||||
ansible.windows.win_service:
|
||||
name: WinRM
|
||||
start_mode: delayed
|
||||
|
||||
#- name: Force Openstack Reboot
|
||||
# openstack.cloud.server_action:
|
||||
# action: "reboot_hard"
|
||||
#name: "{{ ansible_hostname }}"
|
||||
# when: not status | bool
|
||||
|
||||
#- name: Delay WinRM
|
||||
# ansible.windows.win_service:
|
||||
# name: WinRM
|
||||
# start_mode: delayed
|
||||
|
||||
- name: Logging action
|
||||
vars:
|
||||
ansible_connection: local
|
||||
ansible.builtin.shell:
|
||||
cmd: echo "Reboot {{ os_project }}-{{ ansible_hostname }} $(date '+%Y-%m-%d %H:%M:%S')" >> /deployments/{{ os_project }}-{{ win_project }}/action.log
|
||||
delegate_to: localhost
|
||||
- name: Logging action
|
||||
vars:
|
||||
ansible_connection: local
|
||||
ansible.builtin.shell:
|
||||
cmd: echo "Reboot {{ os_project }}-{{ ansible_hostname }} $(date '+%Y-%m-%d %H:%M:%S')" >> /deployments/{{ os_project }}-{{ win_project }}/action.log
|
||||
delegate_to: localhost
|
||||
Reference in new issue
Block a user