use ansible blocks with tags, also use standard layout

This commit is contained in:
abrown38 committed 2024-08-05 11:39:36 +01:00
1 parent cba1130bd9
commit a86a6ba964
2 files changed
+6 -21

No files matched your search

+3 -17
View File
@@ -1,25 +1,11 @@
--- ---
- name: Reboot VM
tags: reboot_vm
block:
- name: Rebooting hosts - name: Rebooting hosts
ansible.windows.win_reboot: ansible.windows.win_reboot:
msg: "rebooting VM, initiated by ansible" msg: "rebooting VM, initiated by ansible"
reboot_timeout: 3600 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: vars:
+3 -4
View File
@@ -1,4 +1,7 @@
--- ---
- name: Update VM
tags: update_vm
block:
- name: Clear update cache - name: Clear update cache
win_shell: | win_shell: |
UsoClient RefreshSettings UsoClient RefreshSettings
@@ -10,10 +13,6 @@
skip_optional: true skip_optional: true
reboot: true reboot: true
reboot_timeout: 3600 reboot_timeout: 3600
vars:
ansible_become: true
ansible_become_pass: "{{ ansible_password }}"
ansible_become_user: Administrator
ignore_errors: true ignore_errors: true
- name: Update Windows (again) - name: Update Windows (again)