win_ansible_role_base_setup/tasks/hostname.yml

10 lines
221 B
YAML
Raw Normal View History

2021-12-20 19:10:07 +01:00
---
- 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