microsoft.iis.web_application module – Configures IIS web applications
Note
This module is part of the microsoft.iis collection (version 1.0.3).
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 If If If not specified, the default is Choices:
|
name string / required | Name of the web application. |
password string | The password associated with Required when |
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 If Choices:
|
username string | Specifies the user name of an account that can access configuration files and content for this application. Required when |
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
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/microsoft/iis/web_application_module.html