New in version 1.7.
parameter | required | default | choices | comments |
---|---|---|---|---|
include_management_tools | no |
| Adds the corresponding management tools to the specified feature. Not supported in Windows 2008. If present when using Windows 2008 this option will be ignored. | |
include_sub_features | no |
| Adds all subfeatures of the specified feature | |
name | yes | Names of roles or features to install as a single feature or a comma-separated list of features | ||
restart | no |
| Restarts the computer automatically when installation is complete, if restarting is required by the roles or features installed. DEPRECATED in Ansible 2.4, as unmanaged reboots cause numerous issues under Ansible. Check the reboot_required return value from this module to determine if a reboot is necessary, and if so, use the win_reboot action to perform it. | |
source (added in 2.1)
| no |
| Specify a source to install the feature from. Not supported in Windows 2008. If present when using Windows 2008 this option will be ignored. | |
state | no | present |
| State of the features or roles on the system |
- 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 restart: True include_sub_features: True include_management_tools: True
Common return values are documented here Return Values, the following are the fields unique to this module:
name | description | returned | type | sample | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
feature_result | List of features that were installed or removed | success | complex | None | ||||||||||||||||||||||||||||||||||||||||
contains: |
| |||||||||||||||||||||||||||||||||||||||||||
restart_needed | DEPRECATED in Ansible 2.4 (refer to reboot_required instead). True when the target server requires a reboot to complete updates (no further updates can be installed until after a reboot) | success | boolean | True | ||||||||||||||||||||||||||||||||||||||||
reboot_required | True when the target server requires a reboot to complete updates (no further updates can be installed until after a reboot) | success | boolean | True | ||||||||||||||||||||||||||||||||||||||||
exitcode | The stringified exit code from the feature installation/removal command | always | string | Success |
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/win_feature_module.html