win_ansible_role_base_setup/tasks/hostname.yml

9 lines
221 B
YAML

---
- name: "Change the hostname to {{ inventory_hostname }}"
ansible.windows.win_hostname:
name: "{{ inventory_hostname }}"
register: res
- name: Reboot
ansible.windows.win_reboot:
when: res.reboot_required