Documentation

vyos_interface - Manage Interface on VyOS network devices

New in version 2.4.

Synopsis

  • This module provides declarative management of Interfaces on VyOS network devices.

Options

parameter required default choices comments
aggregate
no
List of Interfaces definitions.
delay
no 10
Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are state with values up/down and neighbors.
description
no
Description of Interface.
duplex
no auto
  • full
  • half
  • auto
Interface link status.
enabled
no
Interface link status.
mtu
no
Maximum size of transmit packet.
name
yes
Name of the Interface.
speed
no
Interface link speed.
state
no present
  • present
  • absent
  • up
  • down
State of the Interface configuration, up means present and operationally up and down means present and operationally down

Examples

- name: configure interface
  vyos_interface:
    name: eth0
    description: test-interface

- name: remove interface
  vyos_interface:
    name: eth0
    state: absent

- name: make interface down
  vyos_interface:
    name: eth0
    enabled: False

- name: make interface up
  vyos_interface:
    name: eth0
    enabled: True

- name: Configure interface speed, mtu, duplex
  vyos_interface:
    name: eth5
    state: present
    speed: 100
    mtu: 256
    duplex: full

- 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}

- name: Disable interface on aggregate
  net_interface:
    aggregate:
      - name: eth1
      - name: eth2
    enabled: False

- name: Delete interface using aggregate
  net_interface:
    aggregate:
      - name: eth1
      - name: eth2
    state: absent

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
commands
The list of configuration mode commands to send to the device
always, except for the platforms that use Netconf transport to manage the device. list ['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']


Notes

Note

  • Tested against VYOS 1.1.7

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance Info

For more information about Red Hat’s this support of this module, please refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies>

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.