Skip to content

windows_feature

Experimental. A Windows Server role or feature. It never reboots: reboot_required says whether Windows wants one, and windows_reboot does it.

Experimental. Windows support is new, and this module may change between releases.

Use windows_feature to install or remove a Windows Server role or feature. It never reboots a host. When Windows wants one, reboot_required says so, and a windows_reboot step does it, so the reboot shows in the plan.

step "iis" {
windows_feature {
name = "Web-Server"
include_management_tools = true
}
}
step "restart_if_needed" {
windows_reboot {
only_if_pending = true
}
}
step "no_smb1" {
windows_feature {
name = "FS-SMB1"
state = "absent"
}
}
Name Type Required Description
include_management_tools bool No Also install its management tools.
include_sub_features bool No Also install everything under it.
name string Yes Feature name, such as Web-Server.
state string No “present” (default) or “absent”.
timeout string No How long to allow. Defaults to “30m”.

Conn3x sets these; reference them as conn3x_windows_feature.<circuit>__<step>["<host>"].<name>.

Name Type Description
in_sync bool Whether the feature matched at the last refresh.
reboot_required bool Whether Windows reported wanting a reboot after the last change.
revision string Changes each time Conn3x changes this on the host. Handlers watch it.

A step lowers to the conn3x_windows_feature resource, one instance per host, and connects with its circuit’s ssh block.

Features install one at a time per host. An install can take several minutes, and timeout defaults to "30m".

Windows Server only: Windows client has no such feature list. An InstallPending feature counts as installed, and shows reboot_required.

Deleting a windows_feature step leaves the feature as it is. Use state = "absent" to remove one.