Files
windows-ansible/ansible/roles/win_reboot/tasks/reboot.yml
T

16 lines
481 B
YAML

---
- name: Reboot VM
tags: reboot_vm
block:
- name: Rebooting hosts
ansible.windows.win_reboot:
msg: "rebooting VM, initiated by ansible"
reboot_timeout: 3600
- 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