infoblox.nios_modules.nios_next_vlan_id lookup – Return the next available VLAN ID for a VLAN view/range
Note
This lookup plugin is part of the infoblox.nios_modules collection (version 1.8.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 infoblox.nios_modules
.
You need further requirements to be able to use this lookup plugin,
see Requirements for details.
To use it in a playbook, specify: infoblox.nios_modules.nios_next_vlan_id
.
New in infoblox.nios_modules 1.8.0
Synopsis
Uses the Infoblox WAPI API to return the next available VLAN IDs for a given VLAN view/range
Requirements
The below requirements are needed on the local controller node that executes this lookup.
infoblox_client
Keyword parameters
This describes keyword parameters of the lookup. These are the values key1=value1
, key2=value2
and so on in the following
examples: lookup('infoblox.nios_modules.nios_next_vlan_id', key1=value1, key2=value2, ...)
and query('infoblox.nios_modules.nios_next_vlan_id', key1=value1, key2=value2, ...)
Examples
- name: return 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: return 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: return 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'}) }}"
Return Value
Key |
Description |
---|---|
The list of next vlan ids available Returned: always |
Hint
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.