2015-04-24 08:48:02 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2018-02-25 02:09:54 +00:00
|
|
|
# Copyright: (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
2015-04-24 08:48:02 +00:00
|
|
|
|
2017-08-16 03:16:38 +00:00
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
2017-03-14 16:07:22 +00:00
|
|
|
'status': ['preview'],
|
|
|
|
'supported_by': 'community'}
|
|
|
|
|
2017-01-19 01:57:33 +00:00
|
|
|
DOCUMENTATION = r'''
|
2015-04-24 08:48:02 +00:00
|
|
|
---
|
|
|
|
module: win_iis_webapppool
|
2015-06-25 14:05:29 +00:00
|
|
|
version_added: "2.0"
|
2018-02-25 02:09:54 +00:00
|
|
|
short_description: Configure IIS Web Application Pools
|
2015-04-24 08:48:02 +00:00
|
|
|
description:
|
2017-08-15 05:14:39 +00:00
|
|
|
- Creates, removes and configures an IIS Web Application Pool.
|
2015-04-24 08:48:02 +00:00
|
|
|
options:
|
2017-08-15 05:14:39 +00:00
|
|
|
attributes:
|
|
|
|
description:
|
2018-04-25 20:13:37 +00:00
|
|
|
- This field is a free form dictionary value for the application pool
|
|
|
|
attributes.
|
2017-08-15 05:14:39 +00:00
|
|
|
- These attributes are based on the naming standard at
|
|
|
|
U(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 C(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
|
|
|
|
U(http://structuredsight.com/2014/10/26/im-out-of-range-youre-out-of-range/)
|
|
|
|
to help fix your host.
|
2015-04-24 08:48:02 +00:00
|
|
|
name:
|
|
|
|
description:
|
2017-08-15 05:14:39 +00:00
|
|
|
- Name of the application pool.
|
2019-01-03 16:50:44 +00:00
|
|
|
type: str
|
2018-02-25 02:09:54 +00:00
|
|
|
required: yes
|
2015-04-24 08:48:02 +00:00
|
|
|
state:
|
|
|
|
description:
|
2017-08-15 05:14:39 +00:00
|
|
|
- The state of the application pool.
|
|
|
|
- If C(absent) will ensure the app pool is removed.
|
2018-02-25 02:09:54 +00:00
|
|
|
- If C(present) will ensure the app pool is configured and exists.
|
2017-08-15 05:14:39 +00:00
|
|
|
- If C(restarted) will ensure the app pool exists and will restart, this
|
|
|
|
is never idempotent.
|
2018-02-25 02:09:54 +00:00
|
|
|
- If C(started) will ensure the app pool exists and is started.
|
|
|
|
- If C(stopped) will ensure the app pool exists and is stopped.
|
2019-01-03 16:50:44 +00:00
|
|
|
type: str
|
|
|
|
choices: [ absent, present, restarted, started, stopped ]
|
|
|
|
default: present
|
2018-12-15 02:23:59 +00:00
|
|
|
seealso:
|
|
|
|
- module: win_iis_virtualdirectory
|
|
|
|
- module: win_iis_webapplication
|
|
|
|
- module: win_iis_webbinding
|
|
|
|
- module: win_iis_website
|
2017-08-15 05:14:39 +00:00
|
|
|
author:
|
2018-02-25 02:09:54 +00:00
|
|
|
- Henrik Wallström (@henrikwallstrom)
|
|
|
|
- Jordan Borean (@jborean93)
|
2015-04-24 08:48:02 +00:00
|
|
|
'''
|
|
|
|
|
2017-01-19 01:57:33 +00:00
|
|
|
EXAMPLES = r'''
|
2019-01-03 16:50:44 +00:00
|
|
|
- name: Return information about an existing application pool
|
2016-12-15 22:57:26 +00:00
|
|
|
win_iis_webapppool:
|
|
|
|
name: DefaultAppPool
|
2017-08-15 05:14:39 +00:00
|
|
|
state: present
|
2015-04-24 08:48:02 +00:00
|
|
|
|
2019-01-03 16:50:44 +00:00
|
|
|
- name: Create a new application pool in 'Started' state
|
2016-12-15 22:57:26 +00:00
|
|
|
win_iis_webapppool:
|
|
|
|
name: AppPool
|
|
|
|
state: started
|
2015-04-24 08:48:02 +00:00
|
|
|
|
2019-01-03 16:50:44 +00:00
|
|
|
- name: Stop an application pool
|
2016-12-15 22:57:26 +00:00
|
|
|
win_iis_webapppool:
|
|
|
|
name: AppPool
|
|
|
|
state: stopped
|
2015-04-24 08:48:02 +00:00
|
|
|
|
2019-01-03 16:50:44 +00:00
|
|
|
- name: Restart an application pool (non-idempotent)
|
2016-12-15 22:57:26 +00:00
|
|
|
win_iis_webapppool:
|
|
|
|
name: AppPool
|
|
|
|
state: restart
|
2015-04-24 08:48:02 +00:00
|
|
|
|
2019-01-03 16:50:44 +00:00
|
|
|
- name: Change application pool attributes using new dict style
|
2017-08-15 05:14:39 +00:00
|
|
|
win_iis_webapppool:
|
|
|
|
name: AppPool
|
|
|
|
attributes:
|
|
|
|
managedRuntimeVersion: v4.0
|
2018-02-25 02:09:54 +00:00
|
|
|
autoStart: no
|
2017-08-15 05:14:39 +00:00
|
|
|
|
2019-01-03 16:50:44 +00:00
|
|
|
- name: Creates an application pool, sets attributes and starts it
|
2016-12-15 22:57:26 +00:00
|
|
|
win_iis_webapppool:
|
|
|
|
name: AnotherAppPool
|
|
|
|
state: started
|
2017-08-15 05:14:39 +00:00
|
|
|
attributes:
|
|
|
|
managedRuntimeVersion: v4.0
|
2018-02-25 02:09:54 +00:00
|
|
|
autoStart: no
|
2015-04-24 08:48:02 +00:00
|
|
|
|
2017-08-15 05:14:39 +00:00
|
|
|
# In the below example we are setting attributes in child element processModel
|
|
|
|
# https://www.iis.net/configreference/system.applicationhost/applicationpools/add/processmodel
|
2019-01-03 16:50:44 +00:00
|
|
|
- name: Manage child element and set identity of application pool
|
2015-04-24 08:48:02 +00:00
|
|
|
win_iis_webapppool:
|
2017-08-15 05:14:39 +00:00
|
|
|
name: IdentitiyAppPool
|
2015-04-24 08:48:02 +00:00
|
|
|
state: started
|
2017-08-15 05:14:39 +00:00
|
|
|
attributes:
|
|
|
|
managedPipelineMode: Classic
|
|
|
|
processModel.identityType: SpecificUser
|
2017-11-16 14:31:10 +00:00
|
|
|
processModel.userName: '{{ansible_user}}'
|
2017-08-15 05:14:39 +00:00
|
|
|
processModel.password: '{{ansible_password}}'
|
2019-01-03 16:50:44 +00:00
|
|
|
processModel.loadUserProfile: true
|
2017-02-28 11:14:41 +00:00
|
|
|
|
2019-01-03 16:50:44 +00:00
|
|
|
- name: Manage a timespan attribute
|
2017-08-15 05:14:39 +00:00
|
|
|
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"
|
2017-09-28 06:15:55 +00:00
|
|
|
recycling.periodicRestart.schedule: ["00:10:00", "05:30:00"]
|
2017-08-15 05:14:39 +00:00
|
|
|
# Shortened timespan "hour:minute:second"
|
|
|
|
processModel.pingResponseTime: "00:03:00"
|
2015-04-24 08:48:02 +00:00
|
|
|
'''
|
2017-02-28 11:14:41 +00:00
|
|
|
|
2017-08-15 05:14:39 +00:00
|
|
|
RETURN = r'''
|
2017-02-28 11:14:41 +00:00
|
|
|
attributes:
|
2017-08-15 05:14:39 +00:00
|
|
|
description: Application Pool attributes that were set and processed by this
|
|
|
|
module invocation.
|
2017-02-28 11:14:41 +00:00
|
|
|
returned: success
|
2018-12-18 21:25:30 +00:00
|
|
|
type: dict
|
2017-02-28 11:14:41 +00:00
|
|
|
sample:
|
2017-08-15 05:14:39 +00:00
|
|
|
enable32BitAppOnWin64: "true"
|
|
|
|
managedRuntimeVersion: "v4.0"
|
|
|
|
managedPipelineMode: "Classic"
|
2017-02-28 11:14:41 +00:00
|
|
|
info:
|
2017-08-15 05:14:39 +00:00
|
|
|
description: 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.
|
2017-02-28 11:14:41 +00:00
|
|
|
returned: success
|
2017-04-26 14:56:13 +00:00
|
|
|
type: complex
|
2017-02-28 11:14:41 +00:00
|
|
|
sample:
|
|
|
|
contains:
|
|
|
|
attributes:
|
2017-08-15 05:14:39 +00:00
|
|
|
description: Key value pairs showing the current Application Pool attributes.
|
|
|
|
returned: success
|
2018-12-18 21:25:30 +00:00
|
|
|
type: dict
|
2017-08-15 05:14:39 +00:00
|
|
|
sample:
|
|
|
|
autoStart: true
|
|
|
|
managedRuntimeLoader: "webengine4.dll"
|
|
|
|
managedPipelineMode: "Classic"
|
|
|
|
name: "DefaultAppPool"
|
|
|
|
CLRConfigFile: ""
|
|
|
|
passAnonymousToken: true
|
|
|
|
applicationPoolSid: "S-1-5-82-1352790163-598702362-1775843902-1923651883-1762956711"
|
|
|
|
queueLength: 1000
|
|
|
|
managedRuntimeVersion: "v4.0"
|
|
|
|
state: "Started"
|
|
|
|
enableConfigurationOverride: true
|
|
|
|
startMode: "OnDemand"
|
|
|
|
enable32BitAppOnWin64: true
|
|
|
|
cpu:
|
|
|
|
description: Key value pairs showing the current Application Pool cpu attributes.
|
|
|
|
returned: success
|
2018-12-18 21:25:30 +00:00
|
|
|
type: dict
|
2017-08-15 05:14:39 +00:00
|
|
|
sample:
|
|
|
|
action: "NoAction"
|
|
|
|
limit: 0
|
|
|
|
resetInterval:
|
|
|
|
Days: 0
|
|
|
|
Hours: 0
|
|
|
|
failure:
|
|
|
|
description: Key value pairs showing the current Application Pool failure attributes.
|
2017-02-28 11:14:41 +00:00
|
|
|
returned: success
|
2018-12-18 21:25:30 +00:00
|
|
|
type: dict
|
2017-02-28 11:14:41 +00:00
|
|
|
sample:
|
2017-08-15 05:14:39 +00:00
|
|
|
autoShutdownExe: ""
|
|
|
|
orphanActionExe: ""
|
|
|
|
rapidFailProtextionInterval:
|
|
|
|
Days: 0
|
|
|
|
Hours: 0
|
2017-02-28 11:14:41 +00:00
|
|
|
name:
|
2017-08-15 05:14:39 +00:00
|
|
|
description: Name of Application Pool that was processed by this module invocation.
|
2017-02-28 11:14:41 +00:00
|
|
|
returned: success
|
2018-12-18 21:25:30 +00:00
|
|
|
type: str
|
2017-02-28 11:14:41 +00:00
|
|
|
sample: "DefaultAppPool"
|
2017-08-15 05:14:39 +00:00
|
|
|
processModel:
|
|
|
|
description: Key value pairs showing the current Application Pool processModel attributes.
|
|
|
|
returned: success
|
2018-12-18 21:25:30 +00:00
|
|
|
type: dict
|
2017-08-15 05:14:39 +00:00
|
|
|
sample:
|
|
|
|
identityType: "ApplicationPoolIdentity"
|
|
|
|
logonType: "LogonBatch"
|
|
|
|
pingInterval:
|
|
|
|
Days: 0
|
|
|
|
Hours: 0
|
|
|
|
recycling:
|
|
|
|
description: Key value pairs showing the current Application Pool recycling attributes.
|
|
|
|
returned: success
|
2018-12-18 21:25:30 +00:00
|
|
|
type: dict
|
2017-08-15 05:14:39 +00:00
|
|
|
sample:
|
|
|
|
disallowOverlappingRotation: false
|
|
|
|
disallowRotationOnConfigChange: false
|
|
|
|
logEventOnRecycle: "Time,Requests,Schedule,Memory,IsapiUnhealthy,OnDemand,ConfigChange,PrivateMemory"
|
2017-02-28 11:14:41 +00:00
|
|
|
state:
|
2017-08-15 05:14:39 +00:00
|
|
|
description: Current runtime state of the pool as the module completed.
|
2017-02-28 11:14:41 +00:00
|
|
|
returned: success
|
2018-12-18 21:25:30 +00:00
|
|
|
type: str
|
2017-02-28 11:14:41 +00:00
|
|
|
sample: "Started"
|
|
|
|
'''
|