---
title: "NIOS Next VLAN ID"
canonical: "https://docs.infoblox.com/space/niosmodulesansible/1161953453/NIOS%20Next%20VLAN%20ID"
format: markdown
---
Use the `nios_next_vlan_id` plug-in to fetch the next available VLAN ID for a specified VLAN view or range. The plug-in uses the Infoblox WAPI to return the VLAN ID.

The following table describes the parameters you can define in the `nios_next_vlan_id` plug-in:

| **Parameter** | **Required/Optional** | **Description** |
| --- | --- | --- |
| `parent` | Optional | Specifies the VLAN view or range to retrieve the ID from.  
The default value is `default`. |
| `num` | Optional | Specifies the number of VLAN IDs to return. The default value is `1`. |
| `exclude` | Optional | Specifies the list of VLAN IDs to be excluded from the returned VLAN IDs. |
| `provider` | Required | Defines the details of the connection:<br>- `host`: The DNS host name or IP address to connect to the remote instance of NIOS.
- `username`: The user name to use for authenticating the connection to the remote instance.
- `password`: The password to use for authenticating the connection to the remote instance.<br>For information on additional fields you can define, see the list of subparameters in the *[NIOS Modules for Ansible Collections](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/44525470)* topic. |
| `connection` | Required | The `nios_next_vlan_id` module must be run locally. |

## Examples

`name: returns the next available VLAN ID from a VLAN view`  
`ansible.builtin.set_fact:`  
`  networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_vlan_id', parent='vlanview', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"`


`name: returns the next two available VLAN IDs from a VLAN range`  
`ansible.builtin.set_fact:`  
`  networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_vlan_id', parent='vlanrange', num=2,` `provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"`


`name: returns the next available VLAN ID, excluding IDs 1-3`  
`ansible.builtin.set_fact:`  
`  networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_vlan_id', parent='vlanrange', exclude=[1,2,3],` `provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"`