W3cubDocs

/Ansible

community.network.dladm_vnic – Manage VNICs on Solaris/illumos systems.

Note

This plugin is part of the community.network collection (version 3.0.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.network.

To use it in a playbook, specify: community.network.dladm_vnic.

Synopsis

  • Create or delete VNICs on Solaris/illumos systems.

Parameters

Parameter Choices/Defaults Comments
link
string / required
VNIC underlying link name.
mac
string
Default:
"no"
Sets the VNIC's MAC address. Must be valid unicast MAC address.

aliases: macaddr
name
string / required
VNIC name.
state
string
    Choices:
  • present
  • absent
Create or delete Solaris/illumos VNIC.
temporary
boolean
    Choices:
  • no
  • yes
Specifies that the VNIC is temporary. Temporary VNICs do not persist across reboots.
vlan
integer
Default:
"no"
Enable VLAN tagging for this VNIC. The VLAN tag will have id vlan.

aliases: vlan_id

Examples

- name: Create 'vnic0' VNIC over 'bnx0' link
  community.network.dladm_vnic:
    name: vnic0
    link: bnx0
    state: present

- name: Create VNIC with specified MAC and VLAN tag over 'aggr0'
  community.network.dladm_vnic:
    name: vnic1
    link: aggr0
    mac: '00:00:5E:00:53:23'
    vlan: 4

- name: Remove 'vnic0' VNIC
  community.network.dladm_vnic:
    name: vnic0
    link: bnx0
    state: absent

Return Values

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

Key Returned Description
link
string
always
VNIC underlying link name

Sample:
igb0
mac
string
if mac is specified
MAC address to use for VNIC

Sample:
00:00:5E:00:53:42
name
string
always
VNIC name

Sample:
vnic0
state
string
always
state of the target

Sample:
present
temporary
boolean
always
VNIC's persistence

Sample:
True
vlan
integer
success
VLAN to use for VNIC

Sample:
42


Authors

  • Adam Števko (@xen0l)

© 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/network/dladm_vnic_module.html