community.general.proxmox_nic module – Management of a NIC of a Qemu(KVM) VM in a Proxmox VE cluster
Note
This module is part of the community.general collection (version 8.6.4).
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.general
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.proxmox_nic
.
New in community.general 3.1.0
Synopsis
Allows you to create/update/delete a NIC on Qemu(KVM) Virtual Machines in a Proxmox VE cluster.
Aliases: cloud.misc.proxmox_nic
Requirements
The below requirements are needed on the host that executes this module.
proxmoxer
requests
Parameters
Parameter |
Comments |
---|---|
Specify the target host of the Proxmox VE cluster. |
|
Specify the password to authenticate with. You can use |
|
Specify the token ID. Requires |
|
Specify the token secret. Requires |
|
Specify the user to authenticate with. |
|
Add this interface to the specified bridge device. The Proxmox VE default bridge is called |
|
Whether this interface should be protected by the firewall. Choices:
|
|
Name of the interface, should be |
|
Whether this interface should be disconnected (like pulling the plug). Choices:
|
|
When not specified this module will keep the MAC address the same when changing an existing interface. |
|
The NIC emulator model. Choices:
|
|
Force MTU, for Set to Value should be |
|
Specifies the VM name. Only used on the configuration web interface. Required only for |
|
Number of packet queues to be used on the device. Value should be |
|
Rate limit in MBps (MegaBytes per second) as floating point number. |
|
Indicates desired state of the NIC. Choices:
|
|
VLAN tag to apply to packets on this interface. Value should be |
|
List of VLAN trunks to pass through this interface. |
|
If This should only be used on personally controlled sites using self-signed certificates. Choices:
|
|
Specifies the instance ID. |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Create NIC net0 targeting the vm by name
community.general.proxmox_nic:
api_user: root@pam
api_password: secret
api_host: proxmoxhost
name: my_vm
interface: net0
bridge: vmbr0
tag: 3
- name: Create NIC net0 targeting the vm by id
community.general.proxmox_nic:
api_user: root@pam
api_password: secret
api_host: proxmoxhost
vmid: 103
interface: net0
bridge: vmbr0
mac: "12:34:56:C0:FF:EE"
firewall: true
- name: Delete NIC net0 targeting the vm by name
community.general.proxmox_nic:
api_user: root@pam
api_password: secret
api_host: proxmoxhost
name: my_vm
interface: net0
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A short message Returned: always Sample: |
|
The VM vmid. Returned: success Sample: |