win_feature – Installs and uninstalls Windows Features on Windows Server¶
- 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.
- win_chocolatey – Manage packages using chocolatey
- The official documentation on the win_chocolatey module.
- win_package – Installs/uninstalls an installable package
- The official documentation on the win_package module.
- name: Install IIS (Web-Server only) win_feature: name: Web-Server state: present - name: Install IIS (Web-Server and Web-Common-Http) win_feature: name: - Web-Server - Web-Common-Http state: present - name: Install NET-Framework-Core from file 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 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 win_reboot: when: win_feature.reboot_required
Common return values are documented here, the following are the fields unique to this module: