Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxmox: Add PVE version to nodeinfo generated from proxmox_node_info #9231

Open
1 task done
flvmz opened this issue Dec 9, 2024 · 2 comments
Open
1 task done

Proxmox: Add PVE version to nodeinfo generated from proxmox_node_info #9231

flvmz opened this issue Dec 9, 2024 · 2 comments
Labels
feature This issue/PR relates to a feature request module module plugins plugin (any type)

Comments

@flvmz
Copy link

flvmz commented Dec 9, 2024

Summary

Add the pve version information for each pve node to the result of proxmox_node_info.

Issue Type

Feature Idea

Component Name

proxmox_node_info

Additional Information

I would like to get the pve version information added to the information the proxmox_node_info module is generating. I haven't found this information anywhere else in the available proxmox modules.
With this information at hand, it will be possible to check, that all nodes in a cluster are running the same version or that all PVE systems are running specific versions.

As far as my coding skills are concerned, this should easily be achieveable in get_nodes() via self.proxmox_api.nodes(<node>).version.get() for each node and adding this straight as is to the nodes[<node>] dict as version. Might need some failsaves, but this is what I came up with:

def get_nodes(self):
        nodes = self.proxmox_api.nodes.get()
        for node in nodes:
                node['version'] = self.proxmox_api.nodes(node['node']).version.get()
        return nodes

This was tested locally and results in the following (shortened), including version information:

ok: [localhost] => {
    "ret_pve_nodes": {
        "changed": false,
        "failed": false,
        "proxmox_nodes": [
            {
                "id": "node/pve-2-1",
                "node": "pve-2-1",
                "status": "online",
                "type": "node",
                ...
                "version": {
                    "release": "8.2",
                    "repoid": "3e0176e6bb2ade3b",
                    "version": "8.2.7"
                }
            },
            ...
            }
        ]
    }
}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module plugins plugin (any type) labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

2 participants