NIOS VLAN
Use the nios_vlan
module to create, update, or remove instances of NIOS VLAN objects from a NIOS Grid. It supports IPv4 as well as IPv6 networks.
The following table describes the parameters you can define in the nios_vlan
module:
Parameter | Required/Optional | Description |
---|---|---|
| Required | Specifies the name of the VLAN object that you want to add, update, or remove from NIOS. |
| Required | Specifies the ID of the VLAN object. |
| Optional | Specifies the name of the parent VLAN view or VLAN range of the VLAN object. |
| Optional | Specifies the contact information of an individual or a team that manages or uses the VLAN. |
| Optional | Specifies the department where the VLAN object is used. |
| Optional | Describes the VLAN object. This may be used for objects that have long VLAN names. |
| Optional | Determines weather the VLAN should be assigned to IPAM objects manually. |
| Optional | Specifies extensible attributes for the VLAN object. |
| Optional | Specifies the state of the VLAN object instance on the NIOS server.
|
| Optional | Describes the VLAN object. |
| Required | Defines the details of the connection:
For information on additional fields you can define, see the list of subparameters in the NIOS Modules for Ansible Collections topic. |
| Required | The |
Examples
name: Create a new vlan
infoblox.nios_modules.nios_vlan:
name: ansible
id: 10
parent: my_vlanview
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
name: Update the comment for a vlan
infoblox.nios_modules.nios_vlan:
name: ansible
id: 10
parent: my_vlanview
comment: this is an example comment
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
name: Remove the vlan
infoblox.nios_modules.nios_vlan:
name: ansible
id: 10
parent: my_vlanview
state: absent
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
name: Update an existing vlan
infoblox.nios_modules.nios_vlan:
name: {new_name: ansible-new, old_name: ansible}
id: 10
parent: my_vlanview
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
name: Create vlan with extensible attributes
infoblox.nios_modules.nios_vlan:
name: ansible
id: 11
parent: my_vlanview
comment: "this is an example comment"
contact: "itlab@email.com"
department: "IT"
description: "test"
reserved: True
extattrs:
Site: "HQ"
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
name: Create a new vlan with next available id
infoblox.nios_modules.nios_vlan:
name: ansible-vlan
id: "{{
lookup('infoblox.nios_modules.nios_next_vlan_id',
parent='my_vlanrange',
exclude=[1,2],
provider=nios_provider)[0]
}}"
parent: my_vlanrange
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local