mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 15:47:21 +00:00
Portal roles
This commit is contained in:
1 parent
68a34d516e
commit
5329efdffa
8 files changed
+91
No files matched your search
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Reboot VMs and log time
|
||||
hosts: "{{ target_host }}"
|
||||
gather_facts: true
|
||||
roles:
|
||||
- reboot
|
||||
vars_files:
|
||||
- ../vars/vars.yml
|
||||
- ../vars/connection.yml
|
||||
- ../vars/common.yml
|
||||
@@ -0,0 +1,9 @@
|
||||
- name: Running Update Playbook
|
||||
hosts: '{{ target_host }}'
|
||||
gather_facts: true
|
||||
roles:
|
||||
- update
|
||||
vars_files:
|
||||
- ../vars/vars.yml
|
||||
- ../vars/connection.yml
|
||||
- ../vars/common.yml
|
||||
@@ -0,0 +1,2 @@
|
||||
- name: Running reboot roles
|
||||
include_tasks: reboot.yml
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- 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
|
||||
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
|
||||
@@ -0,0 +1,2 @@
|
||||
---
|
||||
dependencies: []
|
||||
@@ -0,0 +1,2 @@
|
||||
- name: Running Update playbook
|
||||
include_tasks: update.yml
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Clear update cache
|
||||
win_shell: |
|
||||
UsoClient RefreshSettings
|
||||
UsoClient ScanInstallWait
|
||||
|
||||
- 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)
|
||||
ansible.windows.win_updates:
|
||||
category_names: '*'
|
||||
reboot: true
|
||||
reboot_timeout: 3600
|
||||
ignore_errors: true
|
||||
|
||||
- name: Logging action
|
||||
vars:
|
||||
ansible_connection: local
|
||||
ansible.builtin.shell:
|
||||
cmd: echo "Update {{ os_project }}-{{ ansible_hostname }} $(date '+%Y-%m-%d %H:%M:%S')" >> /deployments/{{ os_project }}-{{ win_project }}/action.log
|
||||
delegate_to: localhost
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
services:
|
||||
- wuauserv
|
||||
- bits
|
||||
- cryptSvc
|
||||
- msiserver
|
||||
Reference in new issue
Block a user