community.general.proxmox_nic – Management of a NIC of a Qemu(KVM) VM in a Proxmox VE cluster.
Note
This plugin is part of the community.general collection (version 3.8.3).
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
.
To use it in a playbook, specify: community.general.proxmox_nic
.
New in version 3.1.0: of community.general
Synopsis
Allows you to create/update/delete a NIC on Qemu(KVM) Virtual Machines in a Proxmox VE cluster.
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. |
|
Specify the token secret. |
|
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 state=present. |
|
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. |
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: “Nic net0 unchanged on VM with vmid 103” |
|
The VM vmid. Returned: success Sample: 115 |
Authors
Lammert Hellinga (@Kogelvis) <lammert@hellinga.it>