win_disk_image - Manage ISO/VHD/VHDX mounts on Windows hosts

New in version 2.3.

Synopsis

Parameters

Parameter Choices/Defaults Comments
image_path
required
Path to an ISO, VHD, or VHDX image on the target Windows host (the file cannot reside on a network share)
state
    Choices:
  • absent
  • present ←
Whether the image should be present as a drive-letter mount or not.

Examples

# Run installer from mounted ISO, then unmount
- name: Ensure an ISO is mounted
  win_disk_image:
    image_path: C:\install.iso
    state: present
  register: disk_image_out

- name: Run installer from mounted iso
  win_package:
    path: '{{ disk_image_out.mount_paths[0] }}setup\setup.exe'
    product_id: 35a4e767-0161-46b0-979f-e61f282fee21
    state: present

- name: Unmount iso
  win_disk_image:
    image_path: C:\install.iso
    state: absent

Return Values

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

Key Returned Description
mount_path
string
when state is present
filesystem path where the target image is mounted, this has been deprecated in favour of mount_paths

Sample:
F:\
mount_paths
list
when state is present
a list of filesystem paths mounted from the target image

Sample:
['E:\\', 'F:\\']


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance

This module is flagged as core which means that it is maintained by the Ansible Core Team. See Module Maintenance & Support for more info.

For a list of other modules that are also maintained by the Ansible Core Team, see here.

Support

For more information about Red Hat’s support of this module, please refer to this Knowledge Base article

Author

  • Matt Davis (@nitzmahone)

Hint

If you notice any issues in this documentation you can edit this document to improve it.