Join AnsibleFest at Red Hat Summit!

microsoft.iis.web_application module – Configures IIS web applications

Note

This module is part of the microsoft.iis collection (version 1.0.2).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install microsoft.iis. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: microsoft.iis.web_application.

Synopsis

  • Creates, removes, and configures IIS web applications.

Requirements

The below requirements are needed on the host that executes this module.

  • IISAdministration PowerShell module

Parameters

Parameter

Comments

application_pool

string

The application pool in which the new site executes.

If not specified, the application pool of the current website will be used.

connect_as

string

The type of authentication to use for this application. Either pass_through or specific_user.

If pass_through, IIS will use the identity of the user or application pool identity to access the file system or network.

If specific_user, IIS will use the credentials provided in username and password to access the file system or network.

If not specified, the default is pass_through and an existing application will not be modified.

Choices:

  • "pass_through"

  • "specific_user"

name

string / required

Name of the web application.

password

string

The password associated with username.

Required when connect_as=specific_user.

physical_path

aliases: path

string

The physical path on the remote host to use for the new application.

The specified folder must already exist.

site

string / required

Name of the site on which the application is created.

state

string

State of the web application.

If absent, the web application will be removed.

If present, the web application will be created if not already present.

Choices:

  • "absent"

  • "present" ← (default)

username

string

Specifies the user name of an account that can access configuration files and content for this application.

Required when connect_as=specific_user.

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target, if not supported the action will be skipped.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode

platform

Platform: windows

Target OS/families that can be operated against

See Also

See also

microsoft.iis.web_application_info

Get information on IIS Web Applications.

microsoft.iis.web_app_pool

Configure IIS Web Application Pools.

microsoft.iis.website

Configures an IIS website.

Examples

- name: Add ACME web application on IIS
  microsoft.iis.web_application:
    name: api
    site: acme
    state: present
    physical_path: C:\apps\acme\api

- name: Change connect_as to be specific user
  microsoft.iis.web_application:
    name: api
    site: acme
    connect_as: specific_user
    username: acmeuser
    password: acmepassword

- name: Delete ACME web application on IIS
  microsoft.iis.web_application:
    state: absent
    name: api
    site: acme

Authors

  • Henrik Wallström (@henrikwallstrom)