community.windows.win_iis_webapppool 模块 – 配置 IIS Web 应用程序池
注意
此模块是 community.windows 集合 (版本 2.3.0) 的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.windows
。
要在 Playbook 中使用它,请指定:community.windows.win_iis_webapppool
。
概要
创建、删除和配置 IIS Web 应用程序池。
参数
参数 |
注释 |
---|---|
此字段是应用程序池属性的自由格式字典值。 这些属性基于 https://www.iis.net/configreference/system.applicationhost/applicationpools/add#005 上的命名标准,请参阅示例部分,了解有关如何设置此内容的更多详细信息。 您还可以设置子元素(如 cpu 和 processModel)的属性,请参阅示例以了解如何完成此操作。 虽然您可以使用枚举的数值,但建议使用枚举名称本身,例如使用 SpecificUser 而不是 3 作为 processModel.identityType。 managedPipelineMode 可以是“Integrated”或“Classic”。 startMode 可以是“OnDemand”或“AlwaysRunning”。 使用 当尝试设置 'processModel.password' 并收到“值未在预期范围内”错误时,您的密钥库已损坏。 请按照 http://structuredsight.com/2014/10/26/im-out-of-range-youre-out-of-range/ 来帮助修复您的主机。 |
|
应用程序池的名称。 |
|
应用程序池的状态。 如果 如果 如果 如果 如果 选择
|
参见
另请参见
- community.windows.win_iis_virtualdirectory
配置 IIS 中的虚拟目录。
- community.windows.win_iis_webapplication
配置 IIS Web 应用程序。
- community.windows.win_iis_webbinding
配置 IIS 网站绑定。
- community.windows.win_iis_website
配置 IIS 网站。
示例
- 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: false
- name: Creates an application pool, sets attributes and starts it
community.windows.win_iis_webapppool:
name: AnotherAppPool
state: started
attributes:
managedRuntimeVersion: v4.0
autoStart: false
- name: Creates an application pool with "No Managed Code" for .Net compatibility
community.windows.win_iis_webapppool:
name: AnotherAppPool
state: started
attributes:
managedRuntimeVersion: ''
autoStart: false
# 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"
返回值
通用返回值记录在 此处,以下是此模块特有的字段
键 |
描述 |
---|---|
此模块调用设置和处理的应用程序池属性。 已返回: 成功 示例: |
|
有关应用程序池当前状态的信息。请参阅 https://www.iis.net/configreference/system.applicationhost/applicationpools/add#005,了解基于您的 IIS 版本的完整返回属性列表。 已返回: 成功 |
|
显示当前应用程序池属性的键值对。 已返回: 成功 示例: |
|
显示当前应用程序池 CPU 属性的键值对。 已返回: 成功 示例: |
|
显示当前应用程序池失败属性的键值对。 已返回: 成功 示例: |
|
此模块调用处理的应用程序池的名称。 已返回: 成功 示例: |
|
显示当前应用程序池 processModel 属性的键值对。 已返回: 成功 示例: |
|
显示当前应用程序池回收属性的键值对。 已返回: 成功 示例: |
|
模块完成时池的当前运行时状态。 已返回: 成功 示例: |