.. _ansible.windows.win_hostname_module: **************************** ansible.windows.win_hostname **************************** **Manages local Windows computer name** .. contents:: :local: :depth: 1 Synopsis -------- - Manages local Windows computer name. - A reboot is required for the computer name to take effect. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
name
string / required
The hostname to set for the computer.

See Also -------- .. seealso:: :ref:`ansible.windows.win_dns_client_module` The official documentation on the **ansible.windows.win_dns_client** module. Examples -------- .. code-block:: yaml - 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 Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
old_name
string
always
The original hostname that was set before it was changed.

Sample:
old_hostname
reboot_required
boolean
always
Whether a reboot is required to complete the hostname change.

Sample:
True


Status ------ Authors ~~~~~~~ - Ripon Banik (@riponbanik)