mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ovirt_disk: Support ISO image uploads. (#51256)
* Support ISO image uploads. * Fixing missing whitespace.
This commit is contained in:
parent
b2114a9ddf
commit
70c61cff05
1 changed files with 22 additions and 0 deletions
|
@ -75,6 +75,12 @@ options:
|
||||||
- Specify format of the disk.
|
- Specify format of the disk.
|
||||||
- Note that this option isn't idempotent as it's not currently possible to change format of the disk via API.
|
- Note that this option isn't idempotent as it's not currently possible to change format of the disk via API.
|
||||||
choices: ['raw', 'cow']
|
choices: ['raw', 'cow']
|
||||||
|
content_type:
|
||||||
|
description:
|
||||||
|
- Specify if the disk is a data disk or ISO image
|
||||||
|
choices: ['data', 'iso']
|
||||||
|
default: 'data'
|
||||||
|
version_added: "2.8"
|
||||||
sparse:
|
sparse:
|
||||||
required: False
|
required: False
|
||||||
type: bool
|
type: bool
|
||||||
|
@ -247,6 +253,18 @@ EXAMPLES = '''
|
||||||
storage_domain: data
|
storage_domain: data
|
||||||
description: somedescriptionhere
|
description: somedescriptionhere
|
||||||
quota_id: "{{ ovirt_quotas[0]['id'] }}"
|
quota_id: "{{ ovirt_quotas[0]['id'] }}"
|
||||||
|
|
||||||
|
# Upload an ISO image
|
||||||
|
# Since Ansible 2.8
|
||||||
|
- ovirt_disk:
|
||||||
|
name: myiso
|
||||||
|
upload_image_path: /path/to/iso/image
|
||||||
|
storage_domain: data
|
||||||
|
size: 4 GiB
|
||||||
|
wait: true
|
||||||
|
bootable: true
|
||||||
|
format: raw
|
||||||
|
content_type: iso
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
@ -448,6 +466,9 @@ class DisksModule(BaseModule):
|
||||||
format=otypes.DiskFormat(
|
format=otypes.DiskFormat(
|
||||||
self._module.params.get('format')
|
self._module.params.get('format')
|
||||||
) if self._module.params.get('format') else None,
|
) if self._module.params.get('format') else None,
|
||||||
|
content_type=otypes.DiskContentType(
|
||||||
|
self._module.params.get('content_type')
|
||||||
|
) if self._module.params.get('content_type') else None,
|
||||||
sparse=self._module.params.get(
|
sparse=self._module.params.get(
|
||||||
'sparse'
|
'sparse'
|
||||||
) if self._module.params.get(
|
) if self._module.params.get(
|
||||||
|
@ -593,6 +614,7 @@ def main():
|
||||||
profile=dict(default=None),
|
profile=dict(default=None),
|
||||||
quota_id=dict(default=None),
|
quota_id=dict(default=None),
|
||||||
format=dict(default='cow', choices=['raw', 'cow']),
|
format=dict(default='cow', choices=['raw', 'cow']),
|
||||||
|
content_type=dict(default='data', choices=['data', 'iso']),
|
||||||
sparse=dict(default=None, type='bool'),
|
sparse=dict(default=None, type='bool'),
|
||||||
bootable=dict(default=None, type='bool'),
|
bootable=dict(default=None, type='bool'),
|
||||||
shareable=dict(default=None, type='bool'),
|
shareable=dict(default=None, type='bool'),
|
||||||
|
|
Loading…
Reference in a new issue