community.proxmox.proxmox_node module – Manage Proxmox VE nodes

Note

This module is part of the community.proxmox collection (version 1.3.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.proxmox. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: community.proxmox.proxmox_node.

New in community.proxmox 1.2.0

Synopsis

  • Manage the Proxmox VE nodes itself.

Requirements

The below requirements are needed on the host that executes this module.

  • proxmoxer >= 2.0

  • requests

Parameters

Parameter

Comments

api_host

string / required

Specify the target host of the Proxmox VE cluster.

Uses the PROXMOX_HOST environment variable if not specified.

api_password

string

Specify the password to authenticate with.

Uses the PROXMOX_PASSWORD environment variable if not specified.

api_port

integer

Specify the target port of the Proxmox VE cluster.

Uses the PROXMOX_PORT environment variable if not specified.

api_token_id

string

Specify the token ID.

Uses the PROXMOX_TOKEN_ID environment variable if not specified.

api_token_secret

string

Specify the token secret.

Uses the PROXMOX_TOKEN_SECRET environment variable if not specified.

api_user

string / required

Specify the user to authenticate with.

Uses the PROXMOX_USER environment variable if not specified.

certificates

dictionary

Manages the x509 certificates of the node.

cert

string

The public certificate file (including chain) in PEM format.

force

boolean

Overwrite existing custom or ACME certificate files.

Choices:

  • false ← (default)

  • true

key

string

The private key file in PEM format.

restart

boolean

Restart pveproxy to rehash the new certificates.

Choices:

  • false ← (default)

  • true

state

string

Defines the actions for the certificate.

Choices:

  • "present"

  • "absent"

dns

dictionary

Manages the resolving DNS options of the node.

dns1

string

The IP address of the first DNS resolver.

dns2

string

The IP address of the second DNS resolver.

dns3

string

The IP address of the third DNS resolver.

string / required

The default search domain.

node_name

string / required

The targeted node to perform actions on.

power_state

string

Manages the power state of the node.

Choices:

  • "online"

  • "offline"

subscription

dictionary

Manages the license subscription of the node.

key

string

The subscription license key.

state

string

Defines the actions for the subscription file.

Choices:

  • "present"

  • "absent"

validate_certs

boolean

If false, SSL certificates will not be validated.

This should only be used on personally controlled sites using self-signed certificates.

Uses the PROXMOX_VALIDATE_CERTS environment variable if not specified.

Choices:

  • false ← (default)

  • true

Attributes

Attribute

Support

Description

action_group

Action group: community.proxmox.proxmox

Use group/community.proxmox.proxmox in module_defaults to set defaults for this module.

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- name: Start a Proxmox VE Node
  community.proxmox.node:
    api_host: proxmoxhost
    api_user: root@pam
    api_password: password123
    validate_certs: false
    node_name: de-cgn01-virt01
    power_state: online
- name: Update SSL certificates on a Proxmox VE Node
  community.proxmox.node:
    api_host: proxmoxhost
    api_user: root@pam
    api_password: password123
    validate_certs: false
    node_name: de-cgn01-virt01
    certificates:
        key: /opt/ansible/key.pem
        cert: /opt/ansible/cert.pem
        state: present
        force: false
- name: Place a subscription license on a Proxmox VE Node
  community.proxmox.node:
    api_host: proxmoxhost
    api_user: root@pam
    api_password: password123
    validate_certs: false
    node_name: de-cgn01-virt01
    subscription:
        state: present
        key: ABCD-EFGH-IJKL-MNOP-QRST-UVWX-YZ0123456789

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

certificates

string

Status message about the certificate on the node.

Returned: success

Sample: "Certificate for node 'dev-virt01' is already present."

changed

boolean

Indicates whether any changes were made.

Returned: success

Sample: true

dns

string

Status message about the DNS configuration on the node.

Returned: success

Sample: "DNS configuration for node 'dev-virt01' has been updated."

power_state

string

Status message about the power state of the node.

Returned: success

Sample: "Node 'dev-virt01' is already online."

Authors

  • Florian Paul Azim Hoberg (@gyptazy)