ansible / ansible.windows / 2.3.0 / module / win_hostname Manages local Windows computer name Authors: Ripon Banik (@riponbanik)ansible.windows.win_hostname (2.3.0) — module
Install with ansible-galaxy collection install ansible.windows:==2.3.0
collections: - name: ansible.windows version: 2.3.0
Manages local Windows computer name.
A reboot is required for the computer name to take effect.
- name: Change the hostname to sample-hostname ansible.windows.win_hostname: name: sample-hostname register: res
- name: Reboot ansible.windows.win_reboot: when: res.reboot_required
name: description: - The hostname to set for the computer. required: true type: str
old_name: description: The original hostname that was set before it was changed. returned: always sample: old_hostname type: str reboot_required: description: Whether a reboot is required to complete the hostname change. returned: always sample: true type: bool