1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

proxmox_kvm: allow setting format to null (None) (#1028) (#1071)

* Allow setting format to null (None)

* Use string instead of None for consistency

* Add changelog

* Update changelogs/fragments/1028-proxmox-kvm-linked-clone.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/misc/proxmox_kvm.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Substitute 'unspecified' format with None

Co-authored-by: Lukasz Rzasik <lukasz.rzasik@dreamlab.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e3e66a57ec)

Co-authored-by: lukaszrzasik <lukasz.rzasik@gmail.com>
This commit is contained in:
patchback[bot] 2020-10-10 12:36:19 +02:00 committed by GitHub
parent ba10525125
commit 06678d4ce3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 2 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- proxmox_kvm - fix issue causing linked clones not being create by allowing ``format=unspecified`` (https://github.com/ansible-collections/community.general/issues/1027).

View file

@ -120,9 +120,10 @@ options:
description:
- Target drive's backing file's data format.
- Used only with clone
- Use I(format=unspecified) and I(full=false) for a linked clone.
type: str
default: qcow2
choices: [ "cloop", "cow", "qcow", "qcow2", "qed", "raw", "vmdk" ]
choices: [ "cloop", "cow", "qcow", "qcow2", "qed", "raw", "vmdk", "unspecified" ]
freeze:
description:
- Specify if PVE should freeze CPU at startup (use 'c' monitor command to start execution).
@ -472,6 +473,22 @@ EXAMPLES = '''
format: qcow2
timeout: 500
- name: >
Create linked clone VM with only source VM name.
The VM source is spynal.
The target VM name is zavala
community.general.proxmox_kvm:
api_user: root@pam
api_password: secret
api_host: helldorado
clone: spynal
name: zavala
node: sabrewulf
storage: VMs
full: no
format: unspecified
timeout: 500
- name: Clone VM with source vmid and target newid and raw format
community.general.proxmox_kvm:
api_user: root@pam
@ -865,7 +882,7 @@ def main():
description=dict(type='str'),
digest=dict(type='str'),
force=dict(type='bool', default=False),
format=dict(type='str', default='qcow2', choices=['cloop', 'cow', 'qcow', 'qcow2', 'qed', 'raw', 'vmdk']),
format=dict(type='str', default='qcow2', choices=['cloop', 'cow', 'qcow', 'qcow2', 'qed', 'raw', 'vmdk', 'unspecified']),
freeze=dict(type='bool'),
full=dict(type='bool', default=True),
hostpci=dict(type='dict'),
@ -945,6 +962,9 @@ def main():
vmid = module.params['vmid']
validate_certs = module.params['validate_certs']
if module.params['format'] == 'unspecified':
module.params['format'] = None
# If password not set get it from PROXMOX_PASSWORD env
if not api_password:
try: