– Manage ISO/VHD/VHDX mounts on Windows hosts


This plugin is part of the collection (version 1.9.0).

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

To use it in a playbook, specify:


  • Manages mount behavior for a specified ISO, VHD, or VHDX image on a Windows host. When state is present, the image will be mounted under a system-assigned drive letter, which will be returned in the mount_path value of the module result.

  • Requires Windows 8+ or Windows Server 2012+.


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


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

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

- name: Unmount ISO
    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
list / elements=string
when state is present
A list of filesystem paths mounted from the target image.

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


  • Matt Davis (@nitzmahone)