- Description
- Setup - The basics of getting started with iis
- Resource Types - Types, Attributes and valid values
- Limitations - OS compatibility, etc.
This Puppet Module is intended to allow Puppet to manage IIS resources - Site's, Application Pools, Applications and Virtual Directories - on older OS's (Starting from Windows Server 2008) as well as more current OS (Windows Server 2012).
This module will work with older Windows Server 2008 servers, upgraded to at least WMF 3.0 and with the WebAdministration PowerShell SnapIn installed. Later OS's using this Module will instead utilise the WebAdministration Powershell Module which will already be available. Both have very similar functionalities, and this module will account for any deviations.
At the current time, this module assumes the following:
- IIS itself is already installed and configgured (future feature)
- Servers using WMF3.0 have the WebAdministration SnapIn installed (future feature)
The following Resource Types are available:
Example manifest entry for the creation of an IIS Website called 'TestWebsite'
iis_site { 'TestWebsite':
ensure => 'present',
path => 'D:\inetpub\content\TestWebsite',
app_pool => 'TestApplicationPool',
state => 'Started',
hostheader => 'testwebsiteheader',
protocol => 'http',
ip => '127.0.0.1',
port => '80',
ssl => 'false',
}
Property | Description |
---|---|
path: | must be an absolute filepath. |
state: | stopped, started. Defaults to started. |
app_pool: | Must match against the following regex (Defaults to 'DefaultAppPool'): %r{[a-zA-Z0-9-_'\s]+$} |
hostheader: | Must match against the following regex OR 'false': %r{[a-zA-Z0-9-_'.\s]+$} |
protocol: | http, https. Defaults to http. |
ip: | either *, or a valid IPv4 or IPv6 address. Defaults to *. |
port: | Must be a valid port number. Integer, not string. |
ssl: | true, false. Defaults to false. |
Example manifest entry for the creation of an Application Pool called 'TestPool'
iis_pool { 'TestPool':
ensure => 'present',
state => 'Started',
enable_32bit => 'false',
runtime => 'v4.0',
pipeline => 'Integrated',
identitytype => 'SpecificUser',
identity => '<DOMAIN>\TestUserAccount',
identitypassword => 'hopefullynotplaintextpwd',
startmode => 'OnDemand',
rapidfailprotection => 'true',
idletimeout => '8000',
idletimeoutaction => 'Terminate',
maxprocesses => 1,
maxqueue => 1,
recyclemins => 60,
recyclesched => "23:30:00",
}
Property | Description |
---|---|
state: | Stopped, Started. Defaults to Started. |
enable_32bit: | true, false. |
runtime: | v4.0, v2.0, nil. |
pipeline: | Integrated, Classic, 0 (Integrated), 1 (Classic) |
identitytype: | LocalSystem (or 0), LocalService (or 1), |
NetworkService (or 2), | |
SpecificUser (or 3), | |
ApplicationPoolIdentity (or 4) | |
identity: | Must match regex: %r{^[a-zA-Z0-9\-_@.\s]+$} Can Start with a DOMAIN. |
identitypassword: | No validation. Please don't just use plaintext. Use hiera and/or EYAML. |
startmode: | OnDemand, AlwaysRunning, true, false. |
rapidfailprotection: | true, false. |
idletimeout: | Integer. |
idletimeoutaction: | Suspend, Terminate. |
maxprocesses: | Integer. |
maxqueue: | Integer. |
recyclemins: | Integer. |
recyclesched: | String in the format of "HH:MM:SS" |
Example manifest entry for the creation of an IIS Application called 'MyTestApp'.
iis_app { 'D:\inetpub\content\MyTestSite\MyTestApp':
ensure => 'present',
name => 'MyTestApp',
app_pool => 'MyTestAppPool',
parent_site => 'MyTestSite',
}
Property | Description |
---|---|
physicalpath: | Must be an absolute filepath. This is also the namevar, so title your resource accordingly (see example above). This is to prevent duplicate resource names on a server hosting many Web Apps. |
app_pool: | Must match against regex: %r{[a-zA-Z0-9-_'\s]+$}. Defaults to DefaultAppPool. |
parent_site: | Must match against regex: %r{^[a-zA-Z0-9/-_.'\s]+$}. |
Example manifest entry for the creation of a Virtual Directory.
iis_vdir { '/MyTestVDir':
parent_site => 'MyTestSite',
path => 'C:\VdirContents\MyTestVDir',
}
Property | Description |
---|---|
parent_site: | Must match against regex: %r{^[a-zA-Z0-9-_/\s]+$} |
path: | Must be a fully qualified filepath. |
Compatible with the following:
- Windows Server 2008 (with installed WebAdministration Powershell SnapIn and WMF 3.0+)
- Windows Server 2012R2
Other Operating Systems may very well be compatible, however have not as yet been tested against.
Testing has been performed with the following version(s) of Puppet:
- 2016.5.1
Testing has been performed with the following version(s) of Ruby:
- 2.1.9