mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-11-02 20:20: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
+12
-27
No files matched your search
@@ -1,27 +1,13 @@
|
||||
---
|
||||
- name: Rebooting hosts
|
||||
- name: Reboot VM
|
||||
tags: reboot_vm
|
||||
block:
|
||||
- name: Rebooting hosts
|
||||
ansible.windows.win_reboot:
|
||||
msg: "rebooting VM, initiated by ansible"
|
||||
reboot_timeout: 3600
|
||||
register: status
|
||||
|
||||
- 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
|
||||
- name: Logging action
|
||||
vars:
|
||||
ansible_connection: local
|
||||
ansible.builtin.shell:
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
---
|
||||
- name: Clear update cache
|
||||
- name: Update VM
|
||||
tags: update_vm
|
||||
block:
|
||||
- name: Clear update cache
|
||||
win_shell: |
|
||||
UsoClient RefreshSettings
|
||||
UsoClient ScanInstallWait
|
||||
|
||||
- name: Update Windows
|
||||
- name: Update Windows
|
||||
ansible.windows.win_updates:
|
||||
category_names: '*'
|
||||
skip_optional: true
|
||||
reboot: true
|
||||
reboot_timeout: 3600
|
||||
vars:
|
||||
ansible_become: true
|
||||
ansible_become_pass: "{{ ansible_password }}"
|
||||
ansible_become_user: Administrator
|
||||
ignore_errors: true
|
||||
|
||||
- name: Update Windows (again)
|
||||
- name: Update Windows (again)
|
||||
ansible.windows.win_updates:
|
||||
category_names: '*'
|
||||
reboot: true
|
||||
reboot_timeout: 3600
|
||||
ignore_errors: true
|
||||
|
||||
- name: Logging action
|
||||
- name: Logging action
|
||||
vars:
|
||||
ansible_connection: local
|
||||
ansible.builtin.shell:
|
||||
|
||||
Reference in new issue
Block a user