Microsoft IIS site management
This module provides the ability to add/remove websites and application pools from Microsoft IIS.
New in version 2016.3.0.
Set the value of the setting for an IIS container.
site0-apppool-setting:
win_iis.container_setting:
- name: site0
- container: AppPools
- settings:
managedPipelineMode: Integrated
processModel.maxProcesses: 1
processModel.userName: TestUser
processModel.password: TestPassword
processModel.identityType: SpecificUser
Example of usage for the Sites
container:
site0-site-setting:
win_iis.container_setting:
- name: site0
- container: Sites
- settings:
logFile.logFormat: W3C
logFile.period: Daily
limits.maxUrlSegments: 32
Create an IIS application.
Example of usage with only the required arguments:
site0-v1-app:
win_iis.create_app:
- name: v1
- site: site0
- sourcepath: C:\inetpub\site0\v1
Example of usage specifying all available arguments:
site0-v1-app:
win_iis.create_app:
- name: v1
- site: site0
- sourcepath: C:\inetpub\site0\v1
- apppool: site0
Create an IIS application pool.
name (str) -- The name of the IIS application pool.
Usage:
site0-apppool:
win_iis.create_apppool:
- name: site0
Create an IIS binding.
site (str) -- The IIS site name.
hostheader (str) -- The host header of the binding.
ipaddress (str) -- The IP address of the binding.
port (str) -- The TCP port of the binding.
protocol (str) -- The application protocol of the binding.
sslflags (str) -- The flags representing certificate type and storage of the binding.
Example of usage with only the required arguments:
site0-https-binding:
win_iis.create_binding:
- site: site0
Example of usage specifying all available arguments:
site0-https-binding:
win_iis.create_binding:
- site: site0
- hostheader: site0.local
- ipaddress: '*'
- port: 443
- protocol: https
- sslflags: 0
Assign a certificate to an IIS binding.
name (str) -- The thumbprint of the certificate.
site (str) -- The IIS site name.
hostheader (str) -- The host header of the binding.
ipaddress (str) -- The IP address of the binding.
port (str) -- The TCP port of the binding.
sslflags (str) -- Flags representing certificate type and certificate storage of the binding.
Example of usage with only the required arguments:
site0-cert-binding:
win_iis.create_cert_binding:
- name: 9988776655443322111000AAABBBCCCDDDEEEFFF
- site: site0
Example of usage specifying all available arguments:
site0-cert-binding:
win_iis.create_cert_binding:
- name: 9988776655443322111000AAABBBCCCDDDEEEFFF
- site: site0
- hostheader: site0.local
- ipaddress: 192.168.1.199
- port: 443
- sslflags: 1
New in version 2016.11.0.
Create an IIS virtual directory.
Example of usage with only the required arguments:
site0-foo-vdir:
win_iis.create_vdir:
- name: foo
- site: site0
- sourcepath: C:\inetpub\vdirs\foo
Example of usage specifying all available arguments:
site0-foo-vdir:
win_iis.create_vdir:
- name: foo
- site: site0
- sourcepath: C:\inetpub\vdirs\foo
- app: v1
Ensure the website has been deployed.
name (str) -- The IIS site name.
sourcepath (str) -- The physical path of the IIS site.
apppool (str) -- The name of the IIS application pool.
hostheader (str) -- The host header of the binding.
ipaddress (str) -- The IP address of the binding.
port (str) -- The TCP port of the binding.
protocol (str) -- The application protocol of the binding.
Example of usage with only the required arguments. This will default to using the default application pool assigned by IIS:
site0-deployed:
win_iis.deployed:
- name: site0
- sourcepath: C:\inetpub\site0
Example of usage specifying all available arguments:
site0-deployed:
win_iis.deployed:
- name: site0
- sourcepath: C:\inetpub\site0
- apppool: site0
- hostheader: site0.local
- ipaddress: '*'
- port: 443
- protocol: https
Remove an IIS application.
Usage:
site0-v1-app-remove:
win_iis.remove_app:
- name: v1
- site: site0
Remove an IIS application pool.
name (str) -- The name of the IIS application pool.
Usage:
defaultapppool-remove:
win_iis.remove_apppool:
- name: DefaultAppPool
Remove an IIS binding.
Example of usage with only the required arguments:
site0-https-binding-remove:
win_iis.remove_binding:
- site: site0
Example of usage specifying all available arguments:
site0-https-binding-remove:
win_iis.remove_binding:
- site: site0
- hostheader: site0.local
- ipaddress: '*'
- port: 443
Remove a certificate from an IIS binding.
Example of usage with only the required arguments:
site0-cert-binding-remove:
win_iis.remove_cert_binding:
- name: 9988776655443322111000AAABBBCCCDDDEEEFFF
- site: site0
Example of usage specifying all available arguments:
site0-cert-binding-remove:
win_iis.remove_cert_binding:
- name: 9988776655443322111000AAABBBCCCDDDEEEFFF
- site: site0
- hostheader: site0.local
- ipaddress: 192.168.1.199
- port: 443
New in version 2016.11.0.
Delete a website from IIS.
name (str) -- The IIS site name.
Usage:
defaultwebsite-remove:
win_iis.remove_site:
- name: Default Web Site
Remove an IIS virtual directory.
Example of usage with only the required arguments:
site0-foo-vdir-remove:
win_iis.remove_vdir:
- name: foo
- site: site0
Example of usage specifying all available arguments:
site0-foo-vdir-remove:
win_iis.remove_vdir:
- name: foo
- site: site0
- app: v1
New in version 2017.7.0.
Set the value of the setting for an IIS web application.
Note
This function only configures existing app. Params are case sensitive.
Available settings:
physicalPath
- The physical path of the webapp
applicationPool
- The application pool for the webapp
userName
"connectAs" user
password
"connectAs" password for user
Example of usage:
site0-webapp-setting:
win_iis.set_app:
- name: app0
- site: Default Web Site
- settings:
userName: domain\\user
password: pass
physicalPath: c:\inetpub\wwwroot
applicationPool: appPool0
Set the value of webconfiguration settings.
name (str) -- The name of the IIS PSPath containing the settings. Possible PSPaths are : MACHINE, MACHINE/WEBROOT, IIS:, IIS:Sitessitename, ...
settings (dict) -- Dictionaries of dictionaries. You can match a specific item in a collection with this syntax inside a key: 'Collection[{name: site0}].logFile.directory'
Example of usage for the MACHINE/WEBROOT
PSPath:
MACHINE-WEBROOT-level-security:
win_iis.webconfiguration_settings:
- name: 'MACHINE/WEBROOT'
- settings:
system.web/authentication/forms:
requireSSL: True
protection: "All"
credentials.passwordFormat: "SHA1"
system.web/httpCookies:
httpOnlyCookies: True
Example of usage for the IIS:\Sites\site0
PSPath:
site0-IIS-Sites-level-security:
win_iis.webconfiguration_settings:
- name: 'IIS:\Sites\site0'
- settings:
system.webServer/httpErrors:
errorMode: "DetailedLocalOnly"
system.webServer/security/requestFiltering:
allowDoubleEscaping: False
verbs.Collection:
- verb: TRACE
allowed: False
fileExtensions.allowUnlisted: False
Example of usage for the IIS:\
PSPath with a collection matching:
site0-IIS-level-security:
win_iis.webconfiguration_settings:
- name: 'IIS:\'
- settings:
system.applicationHost/sites:
'Collection[{name: site0}].logFile.directory': 'C:\logs\iis\site0'