win_ansible_role_base_setup/tasks/hostname.yml
2022-01-01 21:43:12 +01:00

10 lines
269 B
YAML

---
- name: "Change the hostname to {{ inventory_hostname }}"
ansible.windows.win_hostname:
name: "{{ inventory_hostname }}"
register: res
- name: host is rebooting in 15 sec!!
ansible.windows.win_reboot:
pre_reboot_delay: 15
when: res.reboot_required