Note
This plugin is part of the community.general collection (version 3.8.1).
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
The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
api_host string / required | Specify the target host of the Proxmox VE cluster. | |
api_password string | Specify the password to authenticate with. You can use PROXMOX_PASSWORD environment variable. | |
api_token_id string added in 1.3.0 of community.general | Specify the token ID. | |
api_token_secret string added in 1.3.0 of community.general | Specify the token secret. | |
api_user string / required | Specify the user to authenticate with. | |
bridge string | Add this interface to the specified bridge device. The Proxmox VE default bridge is called vmbr0 . | |
firewall boolean |
| Whether this interface should be protected by the firewall. |
interface string / required | Name of the interface, should be net[n] where 1 ≤ n ≤ 31 . | |
link_down boolean |
| Whether this interface should be disconnected (like pulling the plug). |
mac string | XX:XX:XX:XX:XX:XX should be a unique MAC address. This is automatically generated if not specified.When not specified this module will keep the MAC address the same when changing an existing interface. | |
model string |
| The NIC emulator model. |
mtu integer | Force MTU, for virtio model only, setting will be ignored otherwise.Set to 1 to use the bridge MTU.Value should be 1 ≤ n ≤ 65520 . | |
name string | Specifies the VM name. Only used on the configuration web interface. Required only for state=present. | |
queues integer | Number of packet queues to be used on the device. Value should be 0 ≤ n ≤ 16 . | |
rate float | Rate limit in MBps (MegaBytes per second) as floating point number. | |
state string |
| Indicates desired state of the NIC. |
tag integer | VLAN tag to apply to packets on this interface. Value should be 1 ≤ n ≤ 4094 . | |
trunks list / elements=integer | List of VLAN trunks to pass through this interface. | |
validate_certs boolean |
| If no , SSL certificates will not be validated.This should only be used on personally controlled sites using self-signed certificates. |
vmid integer | Specifies the instance ID. |
- 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
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
msg string | always | A short message Sample: Nic net0 unchanged on VM with vmid 103 |
vmid integer | success | The VM vmid. Sample: 115 |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/proxmox_nic_module.html