ansible / ansible.builtin / v2.9.27 / module / win_hostname Manages local Windows computer name | "added in version" 2.6 of ansible.builtin" Authors: Ripon Banik (@riponbanik) preview | supported by communityansible.builtin.win_hostname (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
Manages local Windows computer name.
A reboot is required for the computer name to take effect.
- name: Change the hostname to sample-hostname win_hostname: name: sample-hostname register: res
- name: Reboot 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