Join AnsibleFest at Red Hat Summit!

microsoft.iis.virtual_directory_info module – Retrive information on a virtual directory in IIS

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

Synopsis

  • Retrive information on a virtual directory in IIS.

Requirements

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

  • IISAdministration PowerShell module

Parameters

Parameter

Comments

application

string

The name of the IIS web application to retrieve the virtual directories from. If unset, all website virtual directories will be returned.

name

string

The name of the virtual directory to get the information for. If unset, all virtual directories will be returned.

site

string

The name of the IIS website to retrieve the virtual directories from. If unset, all website virtual directories will be returned.

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

Configures a virtual directory in IIS.

Examples

- name: Get information for all virtual directories
  microsoft.iis.virtual_directory_info:
  register: vdir_info

- name: Get information for virtual directory on a specific site
  microsoft.iis.virtual_directory_info:
    site: somesite
    name: somedirectory
  register: vdir_info

- name: Get information for virtual directory on a specific site and application
  microsoft.iis.virtual_directory_info:
    site: somesite
    name: somedirectory
    application: someapplication
  register: vdir_info

Return Values

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

Key

Description

directories

list / elements=dictionary

List of virtual directories found.

Returned: success

Sample: "[ { \"name\": \"somedirectory\", \"site\": \"Test Site\", \"physical_path\": \"C:\\\\Users\\\\ansibleAdmin\\\\AppData\\\\Local\\\\Temp\\\\ansible.sgivydkm.qid.test\", \"application\": null, \"username\": \"\" } ]"

application

string

Application name under which the virtual directory exists.

Returned: success

name

string

Name of the virtual directory.

Returned: success

Sample: "somedirectory"

physical_path

string

Physical path of the virtual directory.

Returned: success

Sample: "C:\\Users\\ansibleAdmin\\AppData\\Local\\Temp\\ansible.sgivydkm.qid.test"

site

string

Site name where the virtual directory exists.

Returned: success

Sample: "Test Site"

username

string

Username for the virtual directory when using specific user authentication.

Returned: success

Sample: ""

exists

boolean

Whether any virtual directories were found.

Returned: success

Sample: true

Authors

  • Hen Yaish (@hyaish)