mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #7462/2583c604 backport][stable-8] Add ostype parameter in LXC container clone of Proxmox VE (#7513)
Add ostype parameter in LXC container clone of Proxmox VE (#7462)
* update. proxmox lxc add ostype param
* update.
* update. E501
* update. E123
* update. pullrequestreview-1711205075
* update. commit undo formatted by editor auto-update
* update. add change fragment (pullrequestreview-1711205075)
* update. pullrequestreview-1711911827
(cherry picked from commit 2583c60487
)
Co-authored-by: blacknon <blacknon@orebibou.com>
This commit is contained in:
parent
c5f8719fe9
commit
7d75bb3d7e
2 changed files with 17 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- proxmox_ostype - it is now possible to specify the ``ostype`` when creating an LXC container (https://github.com/ansible-collections/community.general/pull/7462).
|
|
@ -98,6 +98,14 @@ options:
|
||||||
- target storage
|
- target storage
|
||||||
type: str
|
type: str
|
||||||
default: 'local'
|
default: 'local'
|
||||||
|
ostype:
|
||||||
|
description:
|
||||||
|
- Specifies the C(ostype) of the LXC container.
|
||||||
|
- If set to V(auto), no C(ostype) will be provided on instance creation.
|
||||||
|
choices: ['auto', 'debian', 'devuan', 'ubuntu', 'centos', 'fedora', 'opensuse', 'archlinux', 'alpine', 'gentoo', 'nixos', 'unmanaged']
|
||||||
|
type: str
|
||||||
|
default: 'auto'
|
||||||
|
version_added: 8.1.0
|
||||||
cpuunits:
|
cpuunits:
|
||||||
description:
|
description:
|
||||||
- CPU weight for a VM
|
- CPU weight for a VM
|
||||||
|
@ -515,6 +523,9 @@ class ProxmoxLxcAnsible(ProxmoxAnsible):
|
||||||
self.module.fail_json(msg='%s is not a valid tag' % tag)
|
self.module.fail_json(msg='%s is not a valid tag' % tag)
|
||||||
kwargs['tags'] = ",".join(kwargs['tags'])
|
kwargs['tags'] = ",".join(kwargs['tags'])
|
||||||
|
|
||||||
|
if kwargs.get('ostype') == 'auto':
|
||||||
|
kwargs.pop('ostype')
|
||||||
|
|
||||||
if clone is not None:
|
if clone is not None:
|
||||||
if VZ_TYPE != 'lxc':
|
if VZ_TYPE != 'lxc':
|
||||||
self.module.fail_json(changed=False, msg="Clone operator is only supported for LXC enabled proxmox clusters.")
|
self.module.fail_json(changed=False, msg="Clone operator is only supported for LXC enabled proxmox clusters.")
|
||||||
|
@ -637,6 +648,9 @@ def main():
|
||||||
netif=dict(type='dict'),
|
netif=dict(type='dict'),
|
||||||
mounts=dict(type='dict'),
|
mounts=dict(type='dict'),
|
||||||
ip_address=dict(),
|
ip_address=dict(),
|
||||||
|
ostype=dict(default='auto', choices=[
|
||||||
|
'auto', 'debian', 'devuan', 'ubuntu', 'centos', 'fedora', 'opensuse', 'archlinux', 'alpine', 'gentoo', 'nixos', 'unmanaged'
|
||||||
|
]),
|
||||||
onboot=dict(type='bool'),
|
onboot=dict(type='bool'),
|
||||||
features=dict(type='list', elements='str'),
|
features=dict(type='list', elements='str'),
|
||||||
storage=dict(default='local'),
|
storage=dict(default='local'),
|
||||||
|
@ -744,6 +758,7 @@ def main():
|
||||||
ostemplate=module.params['ostemplate'],
|
ostemplate=module.params['ostemplate'],
|
||||||
netif=module.params['netif'],
|
netif=module.params['netif'],
|
||||||
mounts=module.params['mounts'],
|
mounts=module.params['mounts'],
|
||||||
|
ostype=module.params['ostype'],
|
||||||
ip_address=module.params['ip_address'],
|
ip_address=module.params['ip_address'],
|
||||||
onboot=ansible_to_proxmox_bool(module.params['onboot']),
|
onboot=ansible_to_proxmox_bool(module.params['onboot']),
|
||||||
cpuunits=module.params['cpuunits'],
|
cpuunits=module.params['cpuunits'],
|
||||||
|
|
Loading…
Reference in a new issue