community.windows.win_iis_webapplication 模块 – 配置 IIS Web 应用程序

注意

此模块是 community.windows 集合 (版本 2.3.0) 的一部分。

如果您使用的是 ansible 软件包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.windows

要在剧本中使用它,请指定:community.windows.win_iis_webapplication

概要

  • 创建、删除和配置 IIS Web 应用程序。

参数

参数

注释

application_pool

字符串

新站点运行的应用程序池。

如果未指定,则将使用当前网站的应用程序池。

connect_as

字符串

此应用程序使用的身份验证类型。pass_throughspecific_user

如果为 pass_through,IIS 将使用用户或应用程序池身份访问文件系统或网络。

如果为 specific_user,IIS 将使用在 *username* 和 *password* 中提供的凭据访问文件系统或网络。

选项

  • "pass_through"

  • "specific_user"

name

字符串 / 必需

Web 应用程序的名称。

password

字符串

与 *username* 关联的密码。

当 *connect_as* 设置为 specific_user 时必需。

physical_path

字符串

远程主机上用于新应用程序的物理路径。

指定的文件夹必须已存在。

site

字符串 / 必需

创建应用程序的站点的名称。

state

字符串

Web 应用程序的状态。

选项

  • "absent"

  • "present" ← (默认)

username

字符串

指定可以访问此应用程序的配置文件和内容的帐户的用户名。

当 *connect_as* 设置为 specific_user 时必需。

另请参见

另请参见

community.windows.win_iis_virtualdirectory

配置 IIS 中的虚拟目录。

community.windows.win_iis_webapppool

配置 IIS Web 应用程序池。

community.windows.win_iis_webbinding

配置 IIS Web 站点绑定。

community.windows.win_iis_website

配置 IIS Web 站点。

示例

- name: Add ACME webapplication on IIS.
  community.windows.win_iis_webapplication:
    name: api
    site: acme
    state: present
    physical_path: C:\apps\acme\api

返回值

常见的返回值已在此处记录,以下是此模块特有的字段

描述

application_pool

字符串

使用的/已实现的 application_pool 值。

返回:成功

示例:"DefaultAppPool"

connect_as

字符串

IIS 将如何尝试对 physical_path 进行身份验证。

返回:当应用程序存在时

示例:"specific_user"

physical_path

字符串

使用的/已实现的 physical_path 值。

返回:成功

示例:"C:\\apps\\acme\\api"

作者

  • Henrik Wallström (@henrikwallstrom)