|
|
|
@ -82,25 +82,27 @@ author:
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
EXAMPLES = r'''
|
|
|
|
|
# This installs IIS.
|
|
|
|
|
# The names of features available for install can be run by running the following Powershell Command:
|
|
|
|
|
# PS C:\Users\Administrator> Import-Module ServerManager; Get-WindowsFeature
|
|
|
|
|
$ ansible -i hosts -m win_feature -a "name=Web-Server" all
|
|
|
|
|
$ ansible -i hosts -m win_feature -a "name=Web-Server,Web-Common-Http" all
|
|
|
|
|
ansible -m "win_feature" -a "name=NET-Framework-Core source=C:/Temp/iso/sources/sxs" windows
|
|
|
|
|
- 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
|
|
|
|
|
|
|
|
|
|
# Playbook example
|
|
|
|
|
---
|
|
|
|
|
- name: Install IIS
|
|
|
|
|
hosts: all
|
|
|
|
|
gather_facts: false
|
|
|
|
|
tasks:
|
|
|
|
|
- name: Install IIS
|
|
|
|
|
win_feature:
|
|
|
|
|
name: "Web-Server"
|
|
|
|
|
state: present
|
|
|
|
|
restart: yes
|
|
|
|
|
include_sub_features: yes
|
|
|
|
|
include_management_tools: yes
|
|
|
|
|
- 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
|
|
|
|
|
'''
|
|
|
|
|