Releasing soon Vigo is in alpha and closing in on its first stable release. Expect breaking changes between releases until then — we're looking for testing partners with meaningful fleets across diverse architectures. Learn more →

hostname_windows

Sets the Windows hostname idempotently using PowerShell's Rename-Computer cmdlet.

Parameters

Parameter Required Default Description
hostname Yes -- Desired hostname.

States

The hostname_windows executor does not use a state parameter. It always ensures the hostname matches the desired value.

Idempotency

Reads the current hostname via the hostname command and performs a case-insensitive comparison against the desired value. Only changes the hostname when they differ.

Examples

Basic

resources:
  - name: Set hostname
    type: hostname
    hostname: WEB-01

Platform

Windows only. On Linux, type: hostname maps to the hostname executor.

Notes

  • Uses Rename-Computer -NewName '<hostname>' -Force via PowerShell.
  • A reboot may be required for the hostname change to take full effect.
  • Hostname comparison is case-insensitive.