proxmox: fix pubkey translation and usage in update (#9645)
* proxmox: fix: pubkey translation and usage in update * proxmox fix: add changelog * proxmox: fix backticks in changelogpull/9660/head
parent
8749da7756
commit
37a9413a80
|
@ -0,0 +1,3 @@
|
||||||
|
bugfixes:
|
||||||
|
- proxmox - fixes a typo in the translation of the ``pubkey`` parameter to proxmox' ``ssh-public-keys`` (https://github.com/ansible-collections/community.general/issues/9642, https://github.com/ansible-collections/community.general/pull/9645).
|
||||||
|
- proxmox - adds the ``pubkey`` parameter (back to) the ``update`` state (https://github.com/ansible-collections/community.general/issues/9642, https://github.com/ansible-collections/community.general/pull/9645).
|
|
@ -1065,6 +1065,15 @@ class ProxmoxLxcAnsible(ProxmoxAnsible):
|
||||||
if "netif" in kwargs:
|
if "netif" in kwargs:
|
||||||
kwargs.update(kwargs.pop("netif"))
|
kwargs.update(kwargs.pop("netif"))
|
||||||
|
|
||||||
|
if "pubkey" in kwargs:
|
||||||
|
pubkey = kwargs.pop("pubkey")
|
||||||
|
if self.version() >= LooseVersion("4.2"):
|
||||||
|
kwargs["ssh-public-keys"] = pubkey
|
||||||
|
else:
|
||||||
|
self.module.warn(
|
||||||
|
"'pubkey' is not supported for PVE 4.1 and below. Ignoring keyword."
|
||||||
|
)
|
||||||
|
|
||||||
# fetch current config
|
# fetch current config
|
||||||
proxmox_node = self.proxmox_api.nodes(node)
|
proxmox_node = self.proxmox_api.nodes(node)
|
||||||
current_config = getattr(proxmox_node, self.VZ_TYPE)(vmid).config.get()
|
current_config = getattr(proxmox_node, self.VZ_TYPE)(vmid).config.get()
|
||||||
|
@ -1215,7 +1224,7 @@ class ProxmoxLxcAnsible(ProxmoxAnsible):
|
||||||
if "pubkey" in kwargs:
|
if "pubkey" in kwargs:
|
||||||
pubkey = kwargs.pop("pubkey")
|
pubkey = kwargs.pop("pubkey")
|
||||||
if self.version() >= LooseVersion("4.2"):
|
if self.version() >= LooseVersion("4.2"):
|
||||||
kwargs["ssh-public-key"] = pubkey
|
kwargs["ssh-public-keys"] = pubkey
|
||||||
else:
|
else:
|
||||||
self.module.warn(
|
self.module.warn(
|
||||||
"'pubkey' is not supported for PVE 4.1 and below. Ignoring keyword."
|
"'pubkey' is not supported for PVE 4.1 and below. Ignoring keyword."
|
||||||
|
|
Loading…
Reference in New Issue