win_ansible_role_base_setup/tasks/hostname.yml
2021-12-20 22:55:07 +01:00

10 lines
268 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:
re_reboot_delay: 15
when: res.reboot_required