| 1 |
#!/usr/bin/python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
# Copyright: (c) 2015, Henrik Wallström <[email protected]> |
| 5 |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 6 |
|
| 7 |
DOCUMENTATION = r''' |
| 8 |
--- |
| 9 |
module: win_iis_webapppool |
| 10 |
short_description: Configure IIS Web Application Pools |
| 11 |
description: |
| 12 |
- Creates, removes and configures an IIS Web Application Pool. |
| 13 |
deprecated: |
| 14 |
removed_in: 4.0.0 |
| 15 |
why: >- |
| 16 |
This module has been deprecated and an alternative supported module is available in the C(microsoft.iis) collection. |
| 17 |
alternative: Use C(microsoft.iis.web_app_pool) instead. |
| 18 |
options: |
| 19 |
attributes: |
| 20 |
description: |
| 21 |
- This field is a free form dictionary value for the application pool |
| 22 |
attributes. |
| 23 |
- These attributes are based on the naming standard at |
| 24 |
U(https://www.iis.net/configreference/system.applicationhost/applicationpools/add#005), |
| 25 |
see the examples section for more details on how to set this. |
| 26 |
- You can also set the attributes of child elements like cpu and |
| 27 |
processModel, see the examples to see how it is done. |
| 28 |
- While you can use the numeric values for enums it is recommended to use |
| 29 |
the enum name itself, e.g. use SpecificUser instead of 3 for |
| 30 |
processModel.identityType. |
| 31 |
- managedPipelineMode may be either "Integrated" or "Classic". |
| 32 |
- startMode may be either "OnDemand" or "AlwaysRunning". |
| 33 |
- Use C(state) module parameter to modify the state of the app pool. |
| 34 |
- When trying to set 'processModel.password' and you receive a 'Value |
| 35 |
does fall within the expected range' error, you have a corrupted |
| 36 |
keystore. Please follow |
| 37 |
U(http://structuredsight.com/2014/10/26/im-out-of-range-youre-out-of-range/) |
| 38 |
to help fix your host. |
| 39 |
name: |
| 40 |
description: |
| 41 |
- Name of the application pool. |
| 42 |
type: str |
| 43 |
required: yes |
| 44 |
state: |
| 45 |
description: |
| 46 |
- The state of the application pool. |
| 47 |
- If C(absent) will ensure the app pool is removed. |
| 48 |
- If C(present) will ensure the app pool is configured and exists. |
| 49 |
- If C(restarted) will ensure the app pool exists and will restart, this |
| 50 |
is never idempotent. |
| 51 |
- If C(started) will ensure the app pool exists and is started. |
| 52 |
- If C(stopped) will ensure the app pool exists and is stopped. |
| 53 |
type: str |
| 54 |
choices: [ absent, present, restarted, started, stopped ] |
| 55 |
default: present |
| 56 |
seealso: |
| 57 |
- module: community.windows.win_iis_virtualdirectory |
| 58 |
- module: community.windows.win_iis_webapplication |
| 59 |
- module: community.windows.win_iis_webbinding |
| 60 |
- module: community.windows.win_iis_website |
| 61 |
author: |
| 62 |
- Henrik Wallström (@henrikwallstrom) |
| 63 |
- Jordan Borean (@jborean93) |
| 64 |
''' |
| 65 |
|
| 66 |
EXAMPLES = r''' |
| 67 |
- name: Return information about an existing application pool |
| 68 |
community.windows.win_iis_webapppool: |
| 69 |
name: DefaultAppPool |
| 70 |
state: present |
| 71 |
|
| 72 |
- name: Create a new application pool in 'Started' state |
| 73 |
community.windows.win_iis_webapppool: |
| 74 |
name: AppPool |
| 75 |
state: started |
| 76 |
|
| 77 |
- name: Stop an application pool |
| 78 |
community.windows.win_iis_webapppool: |
| 79 |
name: AppPool |
| 80 |
state: stopped |
| 81 |
|
| 82 |
- name: Restart an application pool (non-idempotent) |
| 83 |
community.windows.win_iis_webapppool: |
| 84 |
name: AppPool |
| 85 |
state: restarted |
| 86 |
|
| 87 |
- name: Change application pool attributes using new dict style |
| 88 |
community.windows.win_iis_webapppool: |
| 89 |
name: AppPool |
| 90 |
attributes: |
| 91 |
managedRuntimeVersion: v4.0 |
| 92 |
autoStart: false |
| 93 |
|
| 94 |
- name: Creates an application pool, sets attributes and starts it |
| 95 |
community.windows.win_iis_webapppool: |
| 96 |
name: AnotherAppPool |
| 97 |
state: started |
| 98 |
attributes: |
| 99 |
managedRuntimeVersion: v4.0 |
| 100 |
autoStart: false |
| 101 |
|
| 102 |
- name: Creates an application pool with "No Managed Code" for .Net compatibility |
| 103 |
community.windows.win_iis_webapppool: |
| 104 |
name: AnotherAppPool |
| 105 |
state: started |
| 106 |
attributes: |
| 107 |
managedRuntimeVersion: '' |
| 108 |
autoStart: false |
| 109 |
|
| 110 |
# In the below example we are setting attributes in child element processModel |
| 111 |
# https://www.iis.net/configreference/system.applicationhost/applicationpools/add/processmodel |
| 112 |
- name: Manage child element and set identity of application pool |
| 113 |
community.windows.win_iis_webapppool: |
| 114 |
name: IdentitiyAppPool |
| 115 |
state: started |
| 116 |
attributes: |
| 117 |
managedPipelineMode: Classic |
| 118 |
processModel.identityType: SpecificUser |
| 119 |
processModel.userName: '{{ansible_user}}' |
| 120 |
processModel.password: '{{ansible_password}}' |
| 121 |
processModel.loadUserProfile: true |
| 122 |
|
| 123 |
- name: Manage a timespan attribute |
| 124 |
community.windows.win_iis_webapppool: |
| 125 |
name: TimespanAppPool |
| 126 |
state: started |
| 127 |
attributes: |
| 128 |
# Timespan with full string "day:hour:minute:second.millisecond" |
| 129 |
recycling.periodicRestart.time: "00:00:05:00.000000" |
| 130 |
recycling.periodicRestart.schedule: ["00:10:00", "05:30:00"] |
| 131 |
# Shortened timespan "hour:minute:second" |
| 132 |
processModel.pingResponseTime: "00:03:00" |
| 133 |
''' |
| 134 |
|
| 135 |
RETURN = r''' |
| 136 |
attributes: |
| 137 |
description: Application Pool attributes that were set and processed by this |
| 138 |
module invocation. |
| 139 |
returned: success |
| 140 |
type: dict |
| 141 |
sample: |
| 142 |
enable32BitAppOnWin64: "true" |
| 143 |
managedRuntimeVersion: "v4.0" |
| 144 |
managedPipelineMode: "Classic" |
| 145 |
info: |
| 146 |
description: Information on current state of the Application Pool. See |
| 147 |
https://www.iis.net/configreference/system.applicationhost/applicationpools/add#005 |
| 148 |
for the full list of return attributes based on your IIS version. |
| 149 |
returned: success |
| 150 |
type: complex |
| 151 |
sample: |
| 152 |
contains: |
| 153 |
attributes: |
| 154 |
description: Key value pairs showing the current Application Pool attributes. |
| 155 |
returned: success |
| 156 |
type: dict |
| 157 |
sample: |
| 158 |
autoStart: true |
| 159 |
managedRuntimeLoader: "webengine4.dll" |
| 160 |
managedPipelineMode: "Classic" |
| 161 |
name: "DefaultAppPool" |
| 162 |
CLRConfigFile: "" |
| 163 |
passAnonymousToken: true |
| 164 |
applicationPoolSid: "S-1-5-82-1352790163-598702362-1775843902-1923651883-1762956711" |
| 165 |
queueLength: 1000 |
| 166 |
managedRuntimeVersion: "v4.0" |
| 167 |
state: "Started" |
| 168 |
enableConfigurationOverride: true |
| 169 |
startMode: "OnDemand" |
| 170 |
enable32BitAppOnWin64: true |
| 171 |
cpu: |
| 172 |
description: Key value pairs showing the current Application Pool cpu attributes. |
| 173 |
returned: success |
| 174 |
type: dict |
| 175 |
sample: |
| 176 |
action: "NoAction" |
| 177 |
limit: 0 |
| 178 |
resetInterval: |
| 179 |
Days: 0 |
| 180 |
Hours: 0 |
| 181 |
failure: |
| 182 |
description: Key value pairs showing the current Application Pool failure attributes. |
| 183 |
returned: success |
| 184 |
type: dict |
| 185 |
sample: |
| 186 |
autoShutdownExe: "" |
| 187 |
orphanActionExe: "" |
| 188 |
rapidFailProtextionInterval: |
| 189 |
Days: 0 |
| 190 |
Hours: 0 |
| 191 |
name: |
| 192 |
description: Name of Application Pool that was processed by this module invocation. |
| 193 |
returned: success |
| 194 |
type: str |
| 195 |
sample: "DefaultAppPool" |
| 196 |
processModel: |
| 197 |
description: Key value pairs showing the current Application Pool processModel attributes. |
| 198 |
returned: success |
| 199 |
type: dict |
| 200 |
sample: |
| 201 |
identityType: "ApplicationPoolIdentity" |
| 202 |
logonType: "LogonBatch" |
| 203 |
pingInterval: |
| 204 |
Days: 0 |
| 205 |
Hours: 0 |
| 206 |
recycling: |
| 207 |
description: Key value pairs showing the current Application Pool recycling attributes. |
| 208 |
returned: success |
| 209 |
type: dict |
| 210 |
sample: |
| 211 |
disallowOverlappingRotation: false |
| 212 |
disallowRotationOnConfigChange: false |
| 213 |
logEventOnRecycle: "Time,Requests,Schedule,Memory,IsapiUnhealthy,OnDemand,ConfigChange,PrivateMemory" |
| 214 |
state: |
| 215 |
description: Current runtime state of the pool as the module completed. |
| 216 |
returned: success |
| 217 |
type: str |
| 218 |
sample: "Started" |
| 219 |
''' |