Join AnsibleFest at Red Hat Summit!

microsoft.iis.web_application_info module – Get information on 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_info.

Synopsis

  • Returns information about IIS web applications.

Requirements

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

  • IISAdministration PowerShell module

Parameters

Parameter

Comments

name

string

Name of the web application.

When not specified, information of all existing applications will be fetched or if site is specified, all applications under the site will be fetched.

site

string

Name of the site on which the application is created.

When not specified, information of all existing applications will be fetched unless name is specified.

Can be used in conjunction with name to fetch information for a specific application when name is not unique.

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

Configures IIS web applications.

microsoft.iis.website

Configures an IIS website.

Examples

- name: Fetch info for all applications under SiteA
  microsoft.iis.web_application_info:
    site: SiteA
  register: info

- name: Fetch info for web application MyApp
  microsoft.iis.web_application_info:
    name: MyApp
  register: info

- name: Fetch info for web application MyApp using site and name - Useful when multiple sites have same app name
  microsoft.iis.web_application_info:
    name: MyApp
    site: SiteA
  register: info

- name: Fetch info for all web applications that present in the system
  microsoft.iis.web_application_info:
  register: info

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

applications

list / elements=dictionary

List of applications found.

Returned: success

Sample: "[ { \"application_pool\": \"testpool\", \"enabled_protocols\": \"http\", \"name\": \"TestAppA\", \"physical_path\": \"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Temp\\\\foldera\", \"site\": \"Test Site One\" \"connect_as\": \"pass_through\" \"username\": \"\" }, { \"application_pool\": \"DefaultAppPool\", \"enabled_protocols\": \"http\", \"name\": \"TestAppB\", \"physical_path\": \"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Temp\\\\folderb\", \"site\": \"Test Site Two\" \"connect_as\": \"specific_user\" \"username\": \"testuser\" } ]"

application_pool

string

The application pool the application is associated with.

Returned: success

Sample: "testpool"

connect_as

string

The type of authentication to use for this application.

Returned: success

Sample: "pass_through"

enabled_protocols

string

The enabled protocols for the application.

Returned: success

Sample: "http"

name

string

The name of the application.

Returned: success

Sample: "TestApp"

physical_path

string

The physical path of the application.

Returned: success

Sample: "C:\\Users\\Administrator\\AppData\\Local\\Temp\\AppFolder"

site

string

The site the application is associated with.

Returned: success

Sample: "Test Site One"

username

string

The username of the account that can access configuration files and content for this application when applications.connect_as=specific_user.

Returned: success

Sample: "testuser"

exists

boolean

Whether any applications were found.

Returned: success

Sample: true

Authors

  • Ron Gershburg (@rgershbu)