Debian Codegraph @

ansible_collections/community/windows/plugins/modules/win_disk_image.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright: (c) 2017, Red Hat, Inc.
5 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r'''
8 module: win_disk_image
9 short_description: Manage ISO/VHD/VHDX mounts on Windows hosts
10 description:
11 - Manages mount behavior for a specified ISO, VHD, or VHDX image on a Windows host. When C(state) is C(present),
12 the image will be mounted under a system-assigned drive letter, which will be returned in the C(mount_path) value
13 of the module result.
14 - Requires Windows 8+ or Windows Server 2012+.
15 options:
16 image_path:
17 description:
18 - Path to an ISO, VHD, or VHDX image on the target Windows host (the file cannot reside on a network share)
19 type: str
20 required: yes
21 state:
22 description:
23 - Whether the image should be present as a drive-letter mount or not.
24 type: str
25 choices: [ absent, present ]
26 default: present
27 author:
28 - Matt Davis (@nitzmahone)
29 '''
30
31 EXAMPLES = r'''
32 # Run installer from mounted ISO, then unmount
33 - name: Ensure an ISO is mounted
34 community.windows.win_disk_image:
35 image_path: C:\install.iso
36 state: present
37 register: disk_image_out
38
39 - name: Run installer from mounted ISO
40 ansible.windows.win_package:
41 path: '{{ disk_image_out.mount_paths[0] }}setup\setup.exe'
42 product_id: 35a4e767-0161-46b0-979f-e61f282fee21
43 state: present
44
45 - name: Unmount ISO
46 community.windows.win_disk_image:
47 image_path: C:\install.iso
48 state: absent
49 '''
50
51 RETURN = r'''
52 mount_paths:
53 description: A list of filesystem paths mounted from the target image.
54 returned: when C(state) is C(present)
55 type: list
56 sample: [ 'E:\', 'F:\' ]
57 '''