ansible / ansible.builtin / v2.6.2 / module / win_disk_image Manage ISO/VHD/VHDX mounts on Windows hosts | "added in version" 2.3 of ansible.builtin" Authors: Matt Davis (@nitzmahone) preview | supported by coreansible.builtin.win_disk_image (v2.6.2) — module
pip
Install with pip install ansible==2.6.2
Manages mount behavior for a specified ISO, VHD, or VHDX image on a Windows host. When C(state) is C(present), the image will be mounted under a system-assigned drive letter, which will be returned in the C(mount_path) value of the module result. Requires Windows 8+ or Windows Server 2012+.
# 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_path }}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
state: choices: - absent - present default: present description: - Whether the image should be present as a drive-letter mount or not. image_path: description: - Path to an ISO, VHD, or VHDX image on the target Windows host (the file cannot reside on a network share) required: true
mount_path: description: filesystem path where the target image is mounted returned: when C(state) is C(present) sample: F:\ type: string