netbox_community / netbox_community.ansible_modules / 0.1.10 / module / netbox_vlan Create, update or delete vlans within Netbox | "added in version" 0.1.0 of netbox_community.ansible_modules" Authors: Mikhail Yohman (@FragmentedPacket) preview | supported by communitynetbox_community.ansible_modules.netbox_vlan (0.1.10) — module
Install with ansible-galaxy collection install netbox_community.ansible_modules:==0.1.10
collections: - name: netbox_community.ansible_modules version: 0.1.10
Creates, updates or removes vlans from Netbox
- name: "Test Netbox modules" connection: local hosts: localhost gather_facts: False tasks: - name: Create vlan within Netbox with only required information netbox_vlan: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test VLAN vid: 400 state: present - name: Delete vlan within netbox netbox_vlan: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test VLAN vid: 400 state: absent - name: Create vlan with all information netbox_vlan: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test VLAN vid: 400 site: Test Site group: Test VLAN Group tenant: Test Tenant status: Deprecated vlan_role: Test VLAN Role description: Just a test tags: - Schnozzberry state: present
data: description: - Defines the vlan configuration required: true suboptions: custom_fields: description: - must exist in Netbox description: description: - The description of the vlan name: description: - The name of the vlan required: true site: description: - The site the VLAN will be associated to status: choices: - Active - Reserved - Deprecated description: - The status of the vlan tags: description: - Any tags that the vlan may need to be associated with tenant: description: - The tenant that the vlan will be assigned to vid: description: - The VLAN ID required: true vlan_group: description: - The VLAN group the VLAN will be associated to vlan_role: description: - Required if I(state=present) and the vlan does not exist yet state: choices: - absent - present default: present description: - Use C(present) or C(absent) for adding or removing. netbox_url: description: - URL of the Netbox instance resolvable by Ansible control host required: true netbox_token: description: - The token created within Netbox to authorize API access required: true validate_certs: default: 'yes' description: - If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool
msg: description: Message indicating failure or info about what has been achieved returned: always type: str vlan: description: Serialized object as created or already existent within Netbox returned: success (when I(state=present)) type: dict