mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
proxmox, proxmox_kvm: Deprecate hard-coded defaults (#850)
* Remove hard-coded defaults * Remove hard-coded defaults in proxmox.py * Add changelog * Remove defaults in proxmox docs * Remove more default values * Remove defaults in doc proxmox_kvm * Restore default=True to onboot * Add unspecified back to format * correct changelog format and grammar Co-authored-by: Felix Fontein <felix@fontein.de> * improve changelog * Fix changelog formatting Co-authored-by: Felix Fontein <felix@fontein.de> * Fix changelog formatting * Deprecate before behaviour change * Change changelog * Remove unnecessary ignored sanity tests, fix * Fix * Better mention it too often than too little :) * Deprecate in version 4.0.0 instead of 2.0.0 * Fix changelog * Fix * Remove none values * Improve documentation as suggessted by felixfontein * fix changelog Co-authored-by: Felix Fontein <felix@fontein.de> * Remove default value in force in proxmox_kvm * Add description to force in proxmox_kvm Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
e13ca30e01
commit
d6f5029187
6 changed files with 198 additions and 57 deletions
|
@ -0,0 +1,6 @@
|
||||||
|
minor_changes:
|
||||||
|
- proxmox - add new ``proxmox_default_behavior`` option (https://github.com/ansible-collections/community.general/pull/850).
|
||||||
|
- proxmox_kvm - add new ``proxmox_default_behavior`` option (https://github.com/ansible-collections/community.general/pull/850).
|
||||||
|
deprecated_features:
|
||||||
|
- proxmox - the default of the new ``proxmox_default_behavior`` option will change from ``compatibility`` to ``no_defaults`` in community.general 4.0.0. Set the option to an explicit value to avoid a deprecation warning (https://github.com/ansible-collections/community.general/pull/850).
|
||||||
|
- proxmox_kvm - the default of the new ``proxmox_default_behavior`` option will change from ``compatibility`` to ``no_defaults`` in community.general 4.0.0. Set the option to an explicit value to avoid a deprecation warning (https://github.com/ansible-collections/community.general/pull/850).
|
|
@ -12,6 +12,7 @@ short_description: management of instances in Proxmox VE cluster
|
||||||
description:
|
description:
|
||||||
- allows you to create/delete/stop instances in Proxmox VE cluster
|
- allows you to create/delete/stop instances in Proxmox VE cluster
|
||||||
- Starting in Ansible 2.1, it automatically detects containerization type (lxc for PVE 4, openvz for older)
|
- Starting in Ansible 2.1, it automatically detects containerization type (lxc for PVE 4, openvz for older)
|
||||||
|
- From community.general 4.0.0 on, there will be no default values, see I(proxmox_default_behavior).
|
||||||
options:
|
options:
|
||||||
api_host:
|
api_host:
|
||||||
description:
|
description:
|
||||||
|
@ -68,28 +69,38 @@ options:
|
||||||
disk:
|
disk:
|
||||||
description:
|
description:
|
||||||
- hard disk size in GB for instance
|
- hard disk size in GB for instance
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(3). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: str
|
type: str
|
||||||
default: 3
|
|
||||||
cores:
|
cores:
|
||||||
description:
|
description:
|
||||||
- Specify number of cores per socket.
|
- Specify number of cores per socket.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(1). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 1
|
|
||||||
cpus:
|
cpus:
|
||||||
description:
|
description:
|
||||||
- numbers of allocated cpus for instance
|
- numbers of allocated cpus for instance
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(1). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 1
|
|
||||||
memory:
|
memory:
|
||||||
description:
|
description:
|
||||||
- memory size in MB for instance
|
- memory size in MB for instance
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(512). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 512
|
|
||||||
swap:
|
swap:
|
||||||
description:
|
description:
|
||||||
- swap memory size in MB for instance
|
- swap memory size in MB for instance
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(0). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 0
|
|
||||||
netif:
|
netif:
|
||||||
description:
|
description:
|
||||||
- specifies network interfaces for the container. As a hash/dictionary defining interfaces.
|
- specifies network interfaces for the container. As a hash/dictionary defining interfaces.
|
||||||
|
@ -105,8 +116,10 @@ options:
|
||||||
onboot:
|
onboot:
|
||||||
description:
|
description:
|
||||||
- specifies whether a VM will be started during system bootup
|
- specifies whether a VM will be started during system bootup
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
|
||||||
storage:
|
storage:
|
||||||
description:
|
description:
|
||||||
- target storage
|
- target storage
|
||||||
|
@ -115,8 +128,10 @@ options:
|
||||||
cpuunits:
|
cpuunits:
|
||||||
description:
|
description:
|
||||||
- CPU weight for a VM
|
- CPU weight for a VM
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(1000). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 1000
|
|
||||||
nameserver:
|
nameserver:
|
||||||
description:
|
description:
|
||||||
- sets DNS server IP address for a container
|
- sets DNS server IP address for a container
|
||||||
|
@ -164,6 +179,22 @@ options:
|
||||||
- Script that will be executed during various steps in the containers lifetime.
|
- Script that will be executed during various steps in the containers lifetime.
|
||||||
type: str
|
type: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
|
proxmox_default_behavior:
|
||||||
|
description:
|
||||||
|
- Various module options used to have default values. This cause problems when
|
||||||
|
user expects different behavior from proxmox by default or fill options which cause
|
||||||
|
problems when they have been set.
|
||||||
|
- The default value is C(compatibility), which will ensure that the default values
|
||||||
|
are used when the values are not explicitly specified by the user.
|
||||||
|
- From community.general 4.0.0 on, the default value will switch to C(no_defaults). To avoid
|
||||||
|
deprecation warnings, please set I(proxmox_default_behavior) to an explicit
|
||||||
|
value.
|
||||||
|
- This affects the I(disk), I(cores), I(cpus), I(memory), I(onboot), I(swap), I(cpuunits) options.
|
||||||
|
type: str
|
||||||
|
choices:
|
||||||
|
- compatibility
|
||||||
|
- no_defaults
|
||||||
|
version_added: "1.3.0"
|
||||||
|
|
||||||
notes:
|
notes:
|
||||||
- Requires proxmoxer and requests modules on host. This modules can be installed with pip.
|
- Requires proxmoxer and requests modules on host. This modules can be installed with pip.
|
||||||
|
@ -474,17 +505,17 @@ def main():
|
||||||
password=dict(no_log=True),
|
password=dict(no_log=True),
|
||||||
hostname=dict(),
|
hostname=dict(),
|
||||||
ostemplate=dict(),
|
ostemplate=dict(),
|
||||||
disk=dict(type='str', default='3'),
|
disk=dict(type='str'),
|
||||||
cores=dict(type='int', default=1),
|
cores=dict(type='int'),
|
||||||
cpus=dict(type='int', default=1),
|
cpus=dict(type='int'),
|
||||||
memory=dict(type='int', default=512),
|
memory=dict(type='int'),
|
||||||
swap=dict(type='int', default=0),
|
swap=dict(type='int'),
|
||||||
netif=dict(type='dict'),
|
netif=dict(type='dict'),
|
||||||
mounts=dict(type='dict'),
|
mounts=dict(type='dict'),
|
||||||
ip_address=dict(),
|
ip_address=dict(),
|
||||||
onboot=dict(type='bool', default=False),
|
onboot=dict(type='bool'),
|
||||||
storage=dict(default='local'),
|
storage=dict(default='local'),
|
||||||
cpuunits=dict(type='int', default=1000),
|
cpuunits=dict(type='int'),
|
||||||
nameserver=dict(),
|
nameserver=dict(),
|
||||||
searchdomain=dict(),
|
searchdomain=dict(),
|
||||||
timeout=dict(type='int', default=30),
|
timeout=dict(type='int', default=30),
|
||||||
|
@ -494,6 +525,7 @@ def main():
|
||||||
unprivileged=dict(type='bool', default=False),
|
unprivileged=dict(type='bool', default=False),
|
||||||
description=dict(type='str'),
|
description=dict(type='str'),
|
||||||
hookscript=dict(type='str'),
|
hookscript=dict(type='str'),
|
||||||
|
proxmox_default_behavior=dict(type='str', choices=['compatibility', 'no_defaults']),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -517,6 +549,27 @@ def main():
|
||||||
template_store = module.params['ostemplate'].split(":")[0]
|
template_store = module.params['ostemplate'].split(":")[0]
|
||||||
timeout = module.params['timeout']
|
timeout = module.params['timeout']
|
||||||
|
|
||||||
|
if module.params['proxmox_default_behavior'] is None:
|
||||||
|
module.params['proxmox_default_behavior'] = 'compatibility'
|
||||||
|
module.deprecate(
|
||||||
|
'The proxmox_default_behavior option will change its default value from "compatibility" to '
|
||||||
|
'"no_defaults" in community.general 4.0.0. To remove this warning, please specify an explicit value for it now',
|
||||||
|
version='4.0.0', collection_name='community.general'
|
||||||
|
)
|
||||||
|
if module.params['proxmox_default_behavior'] == 'compatibility':
|
||||||
|
old_default_values = dict(
|
||||||
|
disk="3",
|
||||||
|
cores=1,
|
||||||
|
cpus=1,
|
||||||
|
memory=512,
|
||||||
|
swap=0,
|
||||||
|
onboot=False,
|
||||||
|
cpuunits=1000,
|
||||||
|
)
|
||||||
|
for param, value in old_default_values.items():
|
||||||
|
if module.params[param] is None:
|
||||||
|
module.params[param] = value
|
||||||
|
|
||||||
# If password not set get it from PROXMOX_PASSWORD env
|
# If password not set get it from PROXMOX_PASSWORD env
|
||||||
if not api_password:
|
if not api_password:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -13,13 +13,16 @@ module: proxmox_kvm
|
||||||
short_description: Management of Qemu(KVM) Virtual Machines in Proxmox VE cluster.
|
short_description: Management of Qemu(KVM) Virtual Machines in Proxmox VE cluster.
|
||||||
description:
|
description:
|
||||||
- Allows you to create/delete/stop Qemu(KVM) Virtual Machines in Proxmox VE cluster.
|
- Allows you to create/delete/stop Qemu(KVM) Virtual Machines in Proxmox VE cluster.
|
||||||
|
- From community.general 4.0.0 on, there will be no default values, see I(proxmox_default_behavior).
|
||||||
author: "Abdoul Bah (@helldorado) <bahabdoul at gmail.com>"
|
author: "Abdoul Bah (@helldorado) <bahabdoul at gmail.com>"
|
||||||
options:
|
options:
|
||||||
acpi:
|
acpi:
|
||||||
description:
|
description:
|
||||||
- Specify if ACPI should be enabled/disabled.
|
- Specify if ACPI should be enabled/disabled.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(yes). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: bool
|
type: bool
|
||||||
default: 'yes'
|
|
||||||
agent:
|
agent:
|
||||||
description:
|
description:
|
||||||
- Specify if the QEMU Guest Agent should be enabled/disabled.
|
- Specify if the QEMU Guest Agent should be enabled/disabled.
|
||||||
|
@ -29,7 +32,6 @@ options:
|
||||||
- Pass arbitrary arguments to kvm.
|
- Pass arbitrary arguments to kvm.
|
||||||
- This option is for experts only!
|
- This option is for experts only!
|
||||||
type: str
|
type: str
|
||||||
default: "-serial unix:/var/run/qemu-server/VMID.serial,server,nowait"
|
|
||||||
api_host:
|
api_host:
|
||||||
description:
|
description:
|
||||||
- Specify the target host of the Proxmox VE cluster.
|
- Specify the target host of the Proxmox VE cluster.
|
||||||
|
@ -48,14 +50,18 @@ options:
|
||||||
autostart:
|
autostart:
|
||||||
description:
|
description:
|
||||||
- Specify if the VM should be automatically restarted after crash (currently ignored in PVE API).
|
- Specify if the VM should be automatically restarted after crash (currently ignored in PVE API).
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
|
||||||
balloon:
|
balloon:
|
||||||
description:
|
description:
|
||||||
- Specify the amount of RAM for the VM in MB.
|
- Specify the amount of RAM for the VM in MB.
|
||||||
- Using zero disables the balloon driver.
|
- Using zero disables the balloon driver.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(0). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 0
|
|
||||||
bios:
|
bios:
|
||||||
description:
|
description:
|
||||||
- Specify the BIOS implementation.
|
- Specify the BIOS implementation.
|
||||||
|
@ -65,8 +71,10 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specify the boot order -> boot on floppy C(a), hard disk C(c), CD-ROM C(d), or network C(n).
|
- Specify the boot order -> boot on floppy C(a), hard disk C(c), CD-ROM C(d), or network C(n).
|
||||||
- You can combine to set order.
|
- You can combine to set order.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(cnd). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: str
|
type: str
|
||||||
default: cnd
|
|
||||||
bootdisk:
|
bootdisk:
|
||||||
description:
|
description:
|
||||||
- Enable booting from specified disk. C((ide|sata|scsi|virtio)\d+)
|
- Enable booting from specified disk. C((ide|sata|scsi|virtio)\d+)
|
||||||
|
@ -78,13 +86,17 @@ options:
|
||||||
cores:
|
cores:
|
||||||
description:
|
description:
|
||||||
- Specify number of cores per socket.
|
- Specify number of cores per socket.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(1). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 1
|
|
||||||
cpu:
|
cpu:
|
||||||
description:
|
description:
|
||||||
- Specify emulated CPU type.
|
- Specify emulated CPU type.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(kvm64). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: str
|
type: str
|
||||||
default: kvm64
|
|
||||||
cpulimit:
|
cpulimit:
|
||||||
description:
|
description:
|
||||||
- Specify if CPU usage will be limited. Value 0 indicates no CPU limit.
|
- Specify if CPU usage will be limited. Value 0 indicates no CPU limit.
|
||||||
|
@ -94,8 +106,10 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specify CPU weight for a VM.
|
- Specify CPU weight for a VM.
|
||||||
- You can disable fair-scheduler configuration by setting this to 0
|
- You can disable fair-scheduler configuration by setting this to 0
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(1000). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 1000
|
|
||||||
delete:
|
delete:
|
||||||
description:
|
description:
|
||||||
- Specify a list of settings you want to delete.
|
- Specify a list of settings you want to delete.
|
||||||
|
@ -114,15 +128,20 @@ options:
|
||||||
description:
|
description:
|
||||||
- Allow to force stop VM.
|
- Allow to force stop VM.
|
||||||
- Can be used with states C(stopped), C(restarted) and C(absent).
|
- Can be used with states C(stopped), C(restarted) and C(absent).
|
||||||
default: no
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: bool
|
type: bool
|
||||||
format:
|
format:
|
||||||
description:
|
description:
|
||||||
- Target drive's backing file's data format.
|
- Target drive's backing file's data format.
|
||||||
- Used only with clone
|
- Used only with clone
|
||||||
- Use I(format=unspecified) and I(full=false) for a linked clone.
|
- Use I(format=unspecified) and I(full=false) for a linked clone.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(qcow2). If I(proxmox_default_behavior) is set to C(no_defaults),
|
||||||
|
not specifying this option is equivalent to setting it to C(unspecified).
|
||||||
|
Note that the default value of I(proxmox_default_behavior) changes in community.general 4.0.0.
|
||||||
type: str
|
type: str
|
||||||
default: qcow2
|
|
||||||
choices: [ "cloop", "cow", "qcow", "qcow2", "qed", "raw", "vmdk", "unspecified" ]
|
choices: [ "cloop", "cow", "qcow", "qcow2", "qed", "raw", "vmdk", "unspecified" ]
|
||||||
freeze:
|
freeze:
|
||||||
description:
|
description:
|
||||||
|
@ -173,8 +192,10 @@ options:
|
||||||
kvm:
|
kvm:
|
||||||
description:
|
description:
|
||||||
- Enable/disable KVM hardware virtualization.
|
- Enable/disable KVM hardware virtualization.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(yes). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: bool
|
type: bool
|
||||||
default: 'yes'
|
|
||||||
localtime:
|
localtime:
|
||||||
description:
|
description:
|
||||||
- Sets the real time clock to local time.
|
- Sets the real time clock to local time.
|
||||||
|
@ -193,8 +214,10 @@ options:
|
||||||
memory:
|
memory:
|
||||||
description:
|
description:
|
||||||
- Memory size in MB for instance.
|
- Memory size in MB for instance.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(512). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 512
|
|
||||||
migrate_downtime:
|
migrate_downtime:
|
||||||
description:
|
description:
|
||||||
- Sets maximum tolerated downtime (in seconds) for migrations.
|
- Sets maximum tolerated downtime (in seconds) for migrations.
|
||||||
|
@ -244,15 +267,19 @@ options:
|
||||||
onboot:
|
onboot:
|
||||||
description:
|
description:
|
||||||
- Specifies whether a VM will be started during system bootup.
|
- Specifies whether a VM will be started during system bootup.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(yes). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: bool
|
type: bool
|
||||||
default: 'yes'
|
|
||||||
ostype:
|
ostype:
|
||||||
description:
|
description:
|
||||||
- Specifies guest operating system. This is used to enable special optimization/features for specific operating systems.
|
- Specifies guest operating system. This is used to enable special optimization/features for specific operating systems.
|
||||||
- The l26 is Linux 2.6/3.X Kernel.
|
- The l26 is Linux 2.6/3.X Kernel.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(l26). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: str
|
type: str
|
||||||
choices: ['other', 'wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'win10', 'l24', 'l26', 'solaris']
|
choices: ['other', 'wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'win10', 'l24', 'l26', 'solaris']
|
||||||
default: l26
|
|
||||||
parallel:
|
parallel:
|
||||||
description:
|
description:
|
||||||
- A hash/dictionary of map host parallel devices. C(parallel='{"key":"value", "key":"value"}').
|
- A hash/dictionary of map host parallel devices. C(parallel='{"key":"value", "key":"value"}').
|
||||||
|
@ -328,8 +355,10 @@ options:
|
||||||
sockets:
|
sockets:
|
||||||
description:
|
description:
|
||||||
- Sets the number of CPU sockets. (1 - N).
|
- Sets the number of CPU sockets. (1 - N).
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(1). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: int
|
type: int
|
||||||
default: 1
|
|
||||||
startdate:
|
startdate:
|
||||||
description:
|
description:
|
||||||
- Sets the initial date of the real time clock.
|
- Sets the initial date of the real time clock.
|
||||||
|
@ -355,8 +384,10 @@ options:
|
||||||
tablet:
|
tablet:
|
||||||
description:
|
description:
|
||||||
- Enables/disables the USB tablet device.
|
- Enables/disables the USB tablet device.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
|
||||||
target:
|
target:
|
||||||
description:
|
description:
|
||||||
- Target node. Only allowed if the original VM is on shared storage.
|
- Target node. Only allowed if the original VM is on shared storage.
|
||||||
|
@ -369,8 +400,10 @@ options:
|
||||||
template:
|
template:
|
||||||
description:
|
description:
|
||||||
- Enables/disables the template.
|
- Enables/disables the template.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: bool
|
type: bool
|
||||||
default: 'no'
|
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout for operations.
|
- Timeout for operations.
|
||||||
|
@ -395,9 +428,11 @@ options:
|
||||||
vga:
|
vga:
|
||||||
description:
|
description:
|
||||||
- Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'.
|
- Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'.
|
||||||
|
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||||
|
option has a default of C(std). Note that the default value of I(proxmox_default_behavior)
|
||||||
|
changes in community.general 4.0.0.
|
||||||
type: str
|
type: str
|
||||||
choices: ['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']
|
choices: ['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']
|
||||||
default: std
|
|
||||||
virtio:
|
virtio:
|
||||||
description:
|
description:
|
||||||
- A hash/dictionary of volume used as VIRTIO hard disk. C(virtio='{"key":"value", "key":"value"}').
|
- A hash/dictionary of volume used as VIRTIO hard disk. C(virtio='{"key":"value", "key":"value"}').
|
||||||
|
@ -416,6 +451,25 @@ options:
|
||||||
description:
|
description:
|
||||||
- Creates a virtual hardware watchdog device.
|
- Creates a virtual hardware watchdog device.
|
||||||
type: str
|
type: str
|
||||||
|
proxmox_default_behavior:
|
||||||
|
description:
|
||||||
|
- Various module options used to have default values. This cause problems when
|
||||||
|
user expects different behavior from proxmox by default or fill options which cause
|
||||||
|
problems when they have been set.
|
||||||
|
- The default value is C(compatibility), which will ensure that the default values
|
||||||
|
are used when the values are not explicitly specified by the user.
|
||||||
|
- From community.general 4.0.0 on, the default value will switch to C(no_defaults). To avoid
|
||||||
|
deprecation warnings, please set I(proxmox_default_behavior) to an explicit
|
||||||
|
value.
|
||||||
|
- This affects the I(acpi), I(autostart), I(balloon), I(boot), I(cores), I(cpu),
|
||||||
|
I(cpuunits), I(force), I(format), I(kvm), I(memory), I(onboot), I(ostype), I(sockets),
|
||||||
|
I(tablet), I(template), I(vga), options.
|
||||||
|
type: str
|
||||||
|
choices:
|
||||||
|
- compatibility
|
||||||
|
- no_defaults
|
||||||
|
version_added: "1.3.0"
|
||||||
|
|
||||||
requirements: [ "proxmoxer", "requests" ]
|
requirements: [ "proxmoxer", "requests" ]
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -862,39 +916,39 @@ def proxmox_version(proxmox):
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
acpi=dict(type='bool', default=True),
|
acpi=dict(type='bool'),
|
||||||
agent=dict(type='bool'),
|
agent=dict(type='bool'),
|
||||||
args=dict(type='str', default=None),
|
args=dict(type='str'),
|
||||||
api_host=dict(required=True),
|
api_host=dict(required=True),
|
||||||
api_user=dict(required=True),
|
api_user=dict(required=True),
|
||||||
api_password=dict(no_log=True),
|
api_password=dict(no_log=True),
|
||||||
autostart=dict(type='bool', default=False),
|
autostart=dict(type='bool'),
|
||||||
balloon=dict(type='int', default=0),
|
balloon=dict(type='int'),
|
||||||
bios=dict(choices=['seabios', 'ovmf']),
|
bios=dict(choices=['seabios', 'ovmf']),
|
||||||
boot=dict(type='str', default='cnd'),
|
boot=dict(type='str'),
|
||||||
bootdisk=dict(type='str'),
|
bootdisk=dict(type='str'),
|
||||||
clone=dict(type='str', default=None),
|
clone=dict(type='str', default=None),
|
||||||
cores=dict(type='int', default=1),
|
cores=dict(type='int'),
|
||||||
cpu=dict(type='str', default='kvm64'),
|
cpu=dict(type='str'),
|
||||||
cpulimit=dict(type='int'),
|
cpulimit=dict(type='int'),
|
||||||
cpuunits=dict(type='int', default=1000),
|
cpuunits=dict(type='int'),
|
||||||
delete=dict(type='str', default=None),
|
delete=dict(type='str', default=None),
|
||||||
description=dict(type='str'),
|
description=dict(type='str'),
|
||||||
digest=dict(type='str'),
|
digest=dict(type='str'),
|
||||||
force=dict(type='bool', default=False),
|
force=dict(type='bool'),
|
||||||
format=dict(type='str', default='qcow2', choices=['cloop', 'cow', 'qcow', 'qcow2', 'qed', 'raw', 'vmdk', 'unspecified']),
|
format=dict(type='str', choices=['cloop', 'cow', 'qcow', 'qcow2', 'qed', 'raw', 'vmdk', 'unspecified']),
|
||||||
freeze=dict(type='bool'),
|
freeze=dict(type='bool'),
|
||||||
full=dict(type='bool', default=True),
|
full=dict(type='bool', default=True),
|
||||||
hostpci=dict(type='dict'),
|
hostpci=dict(type='dict'),
|
||||||
hotplug=dict(type='str'),
|
hotplug=dict(type='str'),
|
||||||
hugepages=dict(choices=['any', '2', '1024']),
|
hugepages=dict(choices=['any', '2', '1024']),
|
||||||
ide=dict(type='dict', default=None),
|
ide=dict(type='dict'),
|
||||||
keyboard=dict(type='str'),
|
keyboard=dict(type='str'),
|
||||||
kvm=dict(type='bool', default=True),
|
kvm=dict(type='bool'),
|
||||||
localtime=dict(type='bool'),
|
localtime=dict(type='bool'),
|
||||||
lock=dict(choices=['migrate', 'backup', 'snapshot', 'rollback']),
|
lock=dict(choices=['migrate', 'backup', 'snapshot', 'rollback']),
|
||||||
machine=dict(type='str'),
|
machine=dict(type='str'),
|
||||||
memory=dict(type='int', default=512),
|
memory=dict(type='int'),
|
||||||
migrate_downtime=dict(type='int'),
|
migrate_downtime=dict(type='int'),
|
||||||
migrate_speed=dict(type='int'),
|
migrate_speed=dict(type='int'),
|
||||||
name=dict(type='str'),
|
name=dict(type='str'),
|
||||||
|
@ -903,13 +957,13 @@ def main():
|
||||||
node=dict(),
|
node=dict(),
|
||||||
numa=dict(type='dict'),
|
numa=dict(type='dict'),
|
||||||
numa_enabled=dict(type='bool'),
|
numa_enabled=dict(type='bool'),
|
||||||
onboot=dict(type='bool', default=True),
|
onboot=dict(type='bool'),
|
||||||
ostype=dict(default='l26', choices=['other', 'wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'win10', 'l24', 'l26', 'solaris']),
|
ostype=dict(choices=['other', 'wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'win10', 'l24', 'l26', 'solaris']),
|
||||||
parallel=dict(type='dict'),
|
parallel=dict(type='dict'),
|
||||||
pool=dict(type='str'),
|
pool=dict(type='str'),
|
||||||
protection=dict(type='bool'),
|
protection=dict(type='bool'),
|
||||||
reboot=dict(type='bool'),
|
reboot=dict(type='bool'),
|
||||||
revert=dict(type='str', default=None),
|
revert=dict(type='str'),
|
||||||
sata=dict(type='dict'),
|
sata=dict(type='dict'),
|
||||||
scsi=dict(type='dict'),
|
scsi=dict(type='dict'),
|
||||||
scsihw=dict(choices=['lsi', 'lsi53c810', 'virtio-scsi-pci', 'virtio-scsi-single', 'megasas', 'pvscsi']),
|
scsihw=dict(choices=['lsi', 'lsi53c810', 'virtio-scsi-pci', 'virtio-scsi-single', 'megasas', 'pvscsi']),
|
||||||
|
@ -918,23 +972,24 @@ def main():
|
||||||
skiplock=dict(type='bool'),
|
skiplock=dict(type='bool'),
|
||||||
smbios=dict(type='str'),
|
smbios=dict(type='str'),
|
||||||
snapname=dict(type='str'),
|
snapname=dict(type='str'),
|
||||||
sockets=dict(type='int', default=1),
|
sockets=dict(type='int'),
|
||||||
startdate=dict(type='str'),
|
startdate=dict(type='str'),
|
||||||
startup=dict(),
|
startup=dict(),
|
||||||
state=dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted', 'current']),
|
state=dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted', 'current']),
|
||||||
storage=dict(type='str'),
|
storage=dict(type='str'),
|
||||||
tablet=dict(type='bool', default=False),
|
tablet=dict(type='bool'),
|
||||||
target=dict(type='str'),
|
target=dict(type='str'),
|
||||||
tdf=dict(type='bool'),
|
tdf=dict(type='bool'),
|
||||||
template=dict(type='bool', default=False),
|
template=dict(type='bool'),
|
||||||
timeout=dict(type='int', default=30),
|
timeout=dict(type='int', default=30),
|
||||||
update=dict(type='bool', default=False),
|
update=dict(type='bool', default=False),
|
||||||
validate_certs=dict(type='bool', default=False),
|
validate_certs=dict(type='bool', default=False),
|
||||||
vcpus=dict(type='int', default=None),
|
vcpus=dict(type='int'),
|
||||||
vga=dict(default='std', choices=['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']),
|
vga=dict(choices=['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']),
|
||||||
virtio=dict(type='dict', default=None),
|
virtio=dict(type='dict'),
|
||||||
vmid=dict(type='int', default=None),
|
vmid=dict(type='int', default=None),
|
||||||
watchdog=dict(),
|
watchdog=dict(),
|
||||||
|
proxmox_default_behavior=dict(type='str', choices=['compatibility', 'no_defaults']),
|
||||||
),
|
),
|
||||||
mutually_exclusive=[('delete', 'revert'), ('delete', 'update'), ('revert', 'update'), ('clone', 'update'), ('clone', 'delete'), ('clone', 'revert')],
|
mutually_exclusive=[('delete', 'revert'), ('delete', 'update'), ('revert', 'update'), ('clone', 'update'), ('clone', 'delete'), ('clone', 'revert')],
|
||||||
required_one_of=[('name', 'vmid',)],
|
required_one_of=[('name', 'vmid',)],
|
||||||
|
@ -962,6 +1017,36 @@ def main():
|
||||||
vmid = module.params['vmid']
|
vmid = module.params['vmid']
|
||||||
validate_certs = module.params['validate_certs']
|
validate_certs = module.params['validate_certs']
|
||||||
|
|
||||||
|
if module.params['proxmox_default_behavior'] is None:
|
||||||
|
module.params['proxmox_default_behavior'] = 'compatibility'
|
||||||
|
module.deprecate(
|
||||||
|
'The proxmox_default_behavior option will change its default value from "compatibility" to '
|
||||||
|
'"no_defaults" in community.general 4.0.0. To remove this warning, please specify an explicit value for it now',
|
||||||
|
version='4.0.0', collection_name='community.general'
|
||||||
|
)
|
||||||
|
if module.params['proxmox_default_behavior'] == 'compatibility':
|
||||||
|
old_default_values = dict(
|
||||||
|
acpi=True,
|
||||||
|
autostart=False,
|
||||||
|
balloon=0,
|
||||||
|
boot='cnd',
|
||||||
|
cores=1,
|
||||||
|
cpu='kvm64',
|
||||||
|
cpuunits=1000,
|
||||||
|
force=False,
|
||||||
|
format='qcow2',
|
||||||
|
kvm=True,
|
||||||
|
memory=512,
|
||||||
|
ostype='l26',
|
||||||
|
sockets=1,
|
||||||
|
tablet=False,
|
||||||
|
template=False,
|
||||||
|
vga='std',
|
||||||
|
)
|
||||||
|
for param, value in old_default_values.items():
|
||||||
|
if module.params[param] is None:
|
||||||
|
module.params[param] = value
|
||||||
|
|
||||||
if module.params['format'] == 'unspecified':
|
if module.params['format'] == 'unspecified':
|
||||||
module.params['format'] = None
|
module.params['format'] = None
|
||||||
|
|
||||||
|
|
|
@ -218,7 +218,6 @@ plugins/modules/cloud/memset/memset_server_info.py validate-modules:parameter-ty
|
||||||
plugins/modules/cloud/memset/memset_zone.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/memset/memset_zone.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/cloud/memset/memset_zone_domain.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/memset/memset_zone_domain.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/cloud/memset/memset_zone_record.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/memset/memset_zone_record.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:doc-default-does-not-match-spec
|
|
||||||
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:undocumented-parameter
|
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:undocumented-parameter
|
||||||
plugins/modules/cloud/misc/proxmox_template.py validate-modules:doc-required-mismatch
|
plugins/modules/cloud/misc/proxmox_template.py validate-modules:doc-required-mismatch
|
||||||
|
|
|
@ -218,7 +218,6 @@ plugins/modules/cloud/memset/memset_server_info.py validate-modules:parameter-ty
|
||||||
plugins/modules/cloud/memset/memset_zone.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/memset/memset_zone.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/cloud/memset/memset_zone_domain.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/memset/memset_zone_domain.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/cloud/memset/memset_zone_record.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/memset/memset_zone_record.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:doc-default-does-not-match-spec
|
|
||||||
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:undocumented-parameter
|
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:undocumented-parameter
|
||||||
plugins/modules/cloud/misc/proxmox_template.py validate-modules:doc-required-mismatch
|
plugins/modules/cloud/misc/proxmox_template.py validate-modules:doc-required-mismatch
|
||||||
|
|
|
@ -155,7 +155,6 @@ plugins/modules/cloud/misc/helm.py validate-modules:deprecation-mismatch
|
||||||
plugins/modules/cloud/misc/helm.py validate-modules:invalid-documentation
|
plugins/modules/cloud/misc/helm.py validate-modules:invalid-documentation
|
||||||
plugins/modules/cloud/misc/ovirt.py validate-modules:deprecation-mismatch
|
plugins/modules/cloud/misc/ovirt.py validate-modules:deprecation-mismatch
|
||||||
plugins/modules/cloud/misc/ovirt.py validate-modules:invalid-documentation
|
plugins/modules/cloud/misc/ovirt.py validate-modules:invalid-documentation
|
||||||
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:doc-default-does-not-match-spec
|
|
||||||
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:undocumented-parameter
|
plugins/modules/cloud/misc/proxmox_kvm.py validate-modules:undocumented-parameter
|
||||||
plugins/modules/cloud/oneandone/oneandone_firewall_policy.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/cloud/oneandone/oneandone_firewall_policy.py validate-modules:parameter-type-not-in-doc
|
||||||
|
|
Loading…
Reference in a new issue