Join AnsibleFest at Red Hat Summit!

microsoft.iis.website_info module – Get information on IIS websites

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.website_info.

Synopsis

  • Returns information about IIS websites.

Requirements

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

  • IISAdministration PowerShell module

Parameters

Parameter

Comments

name

string

Name of the website.

When not specified, information of all existing websites will be fetched.

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.website

Configures an IIS website.

Examples

- name: Return information about an existing website
  microsoft.iis.website_info:
    name: 'Default Web Site'
  register: stored_info

- name: Returns information about all websites that exist on the system
  microsoft.iis.website_info:
  register: stored_info_all

Return Values

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

Key

Description

exists

boolean

Whether any website were found.

Returned: always

Sample: true

site

list / elements=dictionary

Contains list of dictionaries.

Every dictionary in the list contains name and information of a website.

Returned: success

Sample: "[\n  {\n    \"name\": \"Default Web Site\",\n    \"state\": \"Started\"\n    \"site_id\": 1,\n    \"physical_path\": \"C:\\\\inetpub\\\\wwwroot\",\n    \"application_pool\": \"DefaultAppPool\",\n    \"bindings\": [\n      {\n        \"ip\": \"127.0.0.1\",\n        \"port\": 80,\n        \"hostname\": \"iis_website.com\",\n        \"protocol\": \"http\",\n        \"use_ccs\": false,\n        \"use_sni\": false\n      }\n    ]\n  }\n]\n"

application_pool

string

Specifies the application pool in which the website runs.

Returned: success

Sample: "DefaultAppPool"

bindings

list / elements=dictionary

List of dictionaries that hold the information of all the website bindings.

Returned: success

certificate_hash

string

The SSL certificate hash used by the server.

Returned: success

Sample: "005930BD42F4869B81150A81B3B922F839412CC7"

certificate_store_name

string

The SSL certificate local store name.

Returned: success

Sample: "MY"

hostname

string

The website binding hostname (DNS).

Returned: success

Sample: "iis_website.com"

ip

string

The website binding listen IP.

Returned: success

Sample: "127.0.0.1"

port

string

The website binding listen port.

Returned: success

Sample: "80"

protocol

string

The website used protocol.

Returned: success

Sample: "http"

use_ccs

string

Use Centralized Certificate Store (CCS) for SSL certificates.

Returned: success

Sample: "true"

use_sni

string

Require Server Name Indication (SNI) for SSL certificates.

Returned: success

Sample: "true"

name

string

Name of the website.

Returned: success

Sample: "Default Web Site"

physical_path

string

Specifies the physical folder path of the website.

Returned: success

Sample: "C:\\inetpub\\wwwroot"

site_id

string

Specifies the website ID.

Returned: success

Sample: "1"

state

string

Specifies the website state Started/Stopped.

Returned: success

Sample: "Started"

Authors

  • Shahar Golshani (@sgolshan)