Documentation

win_iis_webapppool - Configure IIS Web Application Pools

New in version 2.0.

Synopsis

  • Creates, removes and configures an IIS Web Application Pool.

Parameters

Parameter Choices/Defaults Comments
attributes
This field is a free form dictionary value for the application pool attributes.
These attributes are based on the naming standard at https://www.iis.net/configreference/system.applicationhost/applicationpools/add#005, see the examples section for more details on how to set this.
You can also set the attributes of child elements like cpu and processModel, see the examples to see how it is done.
While you can use the numeric values for enums it is recommended to use the enum name itself, e.g. use SpecificUser instead of 3 for processModel.identityType.
managedPipelineMode may be either "Integrated" or "Classic".
startMode may be either "OnDemand" or "AlwaysRunning".
Use state module parameter to modify the state of the app pool.
When trying to set 'processModel.password' and you receive a 'Value does fall within the expected range' error, you have a corrupted keystore. Please follow http://structuredsight.com/2014/10/26/im-out-of-range-youre-out-of-range/ to help fix your host.
name
required
Name of the application pool.
state
    Choices:
  • absent
  • present ←
  • restarted
  • started
  • stopped
The state of the application pool.
If absent will ensure the app pool is removed.
If present will ensure the app pool is configured and exists.
If restarted will ensure the app pool exists and will restart, this is never idempotent.
If started will ensure the app pool exists and is started.
If stopped will ensure the app pool exists and is stopped.

Examples

- name: return information about an existing application pool
  win_iis_webapppool:
    name: DefaultAppPool
    state: present

- name: create a new application pool in 'Started' state
  win_iis_webapppool:
    name: AppPool
    state: started

- name: stop an application pool
  win_iis_webapppool:
    name: AppPool
    state: stopped

- name: restart an application pool (non-idempotent)
  win_iis_webapppool:
    name: AppPool
    state: restart

- name: change application pool attributes using new dict style
  win_iis_webapppool:
    name: AppPool
    attributes:
      managedRuntimeVersion: v4.0
      autoStart: no

- name: creates an application pool, sets attributes and starts it
  win_iis_webapppool:
    name: AnotherAppPool
    state: started
    attributes:
      managedRuntimeVersion: v4.0
      autoStart: no

# In the below example we are setting attributes in child element processModel
# https://www.iis.net/configreference/system.applicationhost/applicationpools/add/processmodel
- name: manage child element and set identity of application pool
  win_iis_webapppool:
    name: IdentitiyAppPool
    state: started
    attributes:
      managedPipelineMode: Classic
      processModel.identityType: SpecificUser
      processModel.userName: '{{ansible_user}}'
      processModel.password: '{{ansible_password}}'
      processModel.loadUserProfile: True

- name: manage a timespan attribute
  win_iis_webapppool:
    name: TimespanAppPool
    state: started
    attributes:
      # Timespan with full string "day:hour:minute:second.millisecond"
      recycling.periodicRestart.time: "00:00:05:00.000000"
      recycling.periodicRestart.schedule: ["00:10:00", "05:30:00"]
      # Shortened timespan "hour:minute:second"
      processModel.pingResponseTime: "00:03:00"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
attributes
dictionary
success
Application Pool attributes that were set and processed by this module invocation.

Sample:
{'managedPipelineMode': 'Classic', 'enable32BitAppOnWin64': 'true', 'managedRuntimeVersion': 'v4.0'}
info
complex
success
Information on current state of the Application Pool. See https://www.iis.net/configreference/system.applicationhost/applicationpools/add#005 for the full list of return attributes based on your IIS version.

  failure
dictionary
success
Key value pairs showing the current Application Pool failure attributes.

Sample:
{'autoShutdownExe': '', 'orphanActionExe': '', 'rapidFailProtextionInterval': {'Hours': 0, 'Days': 0}}
  state
string
success
Current runtime state of the pool as the module completed.

Sample:
Started
  name
string
success
Name of Application Pool that was processed by this module invocation.

Sample:
DefaultAppPool
  attributes
dictionary
success
Key value pairs showing the current Application Pool attributes.

Sample:
{'managedRuntimeLoader': 'webengine4.dll', 'applicationPoolSid': 'S-1-5-82-1352790163-598702362-1775843902-1923651883-1762956711', 'managedPipelineMode': 'Classic', 'enable32BitAppOnWin64': True, 'name': 'DefaultAppPool', 'passAnonymousToken': True, 'CLRConfigFile': '', 'queueLength': 1000, 'state': 'Started', 'enableConfigurationOverride': True, 'autoStart': True, 'startMode': 'OnDemand', 'managedRuntimeVersion': 'v4.0'}
  processModel
dictionary
success
Key value pairs showing the current Application Pool processModel attributes.

Sample:
{'logonType': 'LogonBatch', 'identityType': 'ApplicationPoolIdentity', 'pingInterval': {'Hours': 0, 'Days': 0}}
  recycling
dictionary
success
Key value pairs showing the current Application Pool recycling attributes.

Sample:
{'disallowOverlappingRotation': False, 'disallowRotationOnConfigChange': False, 'logEventOnRecycle': 'Time,Requests,Schedule,Memory,IsapiUnhealthy,OnDemand,ConfigChange,PrivateMemory'}
  cpu
dictionary
success
Key value pairs showing the current Application Pool cpu attributes.

Sample:
{'action': 'NoAction', 'limit': 0, 'resetInterval': {'Hours': 0, 'Days': 0}}


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance

This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.

For a list of other modules that are also maintained by the Ansible Community, see here.

Author

  • Henrik Wallström (@henrikwallstrom)
  • Jordan Borean (@jborean93)

Hint

If you notice any issues in this documentation you can edit this document to improve it.