ansible.builtin.junos_vlan (v2.4.6.0-1) — module

Manage VLANs on Juniper JUNOS network devices

| "added in version" 2.4 of ansible.builtin"

Authors: Ganesh Nalawade (@ganeshrn)

preview | supported by network

Install Ansible via pip

Install with pip install ansible==2.4.6.0.post1

Description

This module provides declarative management of VLANs on Juniper JUNOS network devices.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure VLAN ID and name
  junos_vlan:
    vlan_name: test
    vlan_id: 20
    name: test-vlan
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove VLAN configuration
  junos_vlan:
    vlan_name: test
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: deactive VLAN configuration
  junos_vlan:
    vlan_name: test
    state: present
    active: False
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: activate VLAN configuration
  junos_vlan:
    vlan_name: test
    state: present
    active: True
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create vlan configuration using aggregate
  junos_vlan:
    aggregate:
      - { vlan_id: 159, name: test_vlan_1, description: test vlan-1 }
      - { vlan_id: 160, name: test_vlan_2, description: test vlan-2 }
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete vlan configuration using aggregate
  junos_vlan:
    aggregate:
      - { vlan_id: 159, name: test_vlan_1 }
      - { vlan_id: 160, name: test_vlan_2 }
    state: absent

Inputs

    
name:
    description:
    - Name of the VLAN.
    required: true

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the VLAN configuration.

active:
    choices:
    - true
    - false
    default: true
    description:
    - Specifies whether or not the configuration is active or deactivated

vlan_id:
    description:
    - ID of the VLAN.
    required: true

aggregate:
    description: List of VLANs definitions.

interfaces:
    description:
    - List of interfaces to check the VLAN has been configured correctly.

description:
    description:
    - Text description of VLANs.

Outputs

diff.prepared:
  description: Configuration difference before and after applying change.
  returned: when configuration is changed and diff option is enabled.
  sample: '[edit vlans] +   test-vlan-1 { +       vlan-id 60; +   }

    '
  type: string