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.| Parameter | Choices/Defaults | Comments |
|---|---|---|
| image_path string / required | Path to an ISO, VHD, or VHDX image on the target Windows host (the file cannot reside on a network share) | |
| state string |
| 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
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
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:\\'] |
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/win_disk_image_module.html