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

Manage Interface on VyOS 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 Interfaces on VyOS network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure interface
  vyos_interface:
    name: eth0
    description: test-interface
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove interface
  vyos_interface:
    name: eth0
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: make interface down
  vyos_interface:
    name: eth0
    enabled: False
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: make interface up
  vyos_interface:
    name: eth0
    enabled: True
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure interface speed, mtu, duplex
  vyos_interface:
    name: eth5
    state: present
    speed: 100
    mtu: 256
    duplex: full
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set interface using aggregate
  vyos_interface:
    aggregate:
      - { name: eth1, description: test-interface-1,  speed: 100, duplex: half, mtu: 512}
      - { name: eth2, description: test-interface-2,  speed: 1000, duplex: full, mtu: 256}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Disable interface on aggregate
  net_interface:
    aggregate:
      - name: eth1
      - name: eth2
    enabled: False
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete interface using aggregate
  net_interface:
    aggregate:
      - name: eth1
      - name: eth2
    state: absent

Inputs

    
mtu:
    description:
    - Maximum size of transmit packet.

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

delay:
    default: 10
    description:
    - Time in seconds to wait before checking for the operational state on remote device.
      This wait is applicable for operational state argument which are I(state) with values
      C(up)/C(down) and I(neighbors).

speed:
    description:
    - Interface link speed.

state:
    choices:
    - present
    - absent
    - up
    - down
    default: present
    description:
    - State of the Interface configuration, C(up) means present and operationally up and
      C(down) means present and operationally C(down)

duplex:
    choices:
    - full
    - half
    - auto
    default: auto
    description:
    - Interface link status.

enabled:
    description:
    - Interface link status.

aggregate:
    description: List of Interfaces definitions.

description:
    description:
    - Description of Interface.

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always, except for the platforms that use Netconf transport to manage
    the device.
  sample:
  - set interfaces ethernet eth0 description "test-interface"
  - set interfaces ethernet eth0 speed 100
  - set interfaces ethernet eth0 mtu 256
  - set interfaces ethernet eth0 duplex full
  type: list