community.windows.win_iis_webapppool
该模块用来查看和启动停止和重启 windows IIS 的服务
example
- name: Return information about an existing application pool
community.windows.win_iis_webapppool:
name: DefaultAppPool
state: present
- name: Create a new application pool in 'Started' state
community.windows.win_iis_webapppool:
name: AppPool
state: started
- name: Stop an application pool
community.windows.win_iis_webapppool:
name: AppPool
state: stopped
- name: Restart an application pool (non-idempotent)
community.windows.win_iis_webapppool:
name: AppPool
state: restarted
- name: Change application pool attributes using new dict style
community.windows.win_iis_webapppool:
name: AppPool
attributes:
managedRuntimeVersion: v4.0
autoStart: no
- name: Creates an application pool, sets attributes and starts it
community.windows.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
community.windows.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
community.windows.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"
ansible-console
win_iis_webapppool name=