ansible.windows.win_feature – Installs and uninstalls Windows Features on Windows Server¶
Note
This plugin is part of the ansible.windows collection (version 1.5.0).
To install it use: ansible-galaxy collection install ansible.windows
.
To use it in a playbook, specify: ansible.windows.win_feature
.
Synopsis¶
Installs or uninstalls Windows Roles or Features on Windows Server.
This module uses the Add/Remove-WindowsFeature Cmdlets on Windows 2008 R2 and Install/Uninstall-WindowsFeature Cmdlets on Windows 2012, which are not available on client os machines.
Parameters¶
See Also¶
See also
- chocolatey.chocolatey.win_chocolatey
The official documentation on the chocolatey.chocolatey.win_chocolatey module.
- ansible.windows.win_package
The official documentation on the ansible.windows.win_package module.
Examples¶
- name: Install IIS (Web-Server only)
ansible.windows.win_feature:
name: Web-Server
state: present
- name: Install IIS (Web-Server and Web-Common-Http)
ansible.windows.win_feature:
name:
- Web-Server
- Web-Common-Http
state: present
- name: Install NET-Framework-Core from file
ansible.windows.win_feature:
name: NET-Framework-Core
source: C:\Temp\iso\sources\sxs
state: present
- name: Install IIS Web-Server with sub features and management tools
ansible.windows.win_feature:
name: Web-Server
state: present
include_sub_features: yes
include_management_tools: yes
register: win_feature
- name: Reboot if installing Web-Server feature requires it
ansible.windows.win_reboot:
when: win_feature.reboot_required
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Paul Durivage (@angstwad)
Trond Hindenes (@trondhindenes)