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.

Parameters

Parameter Choices/Defaults Comments
aggregate
List of Interfaces definitions.
delay Default:
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
Description of Interface.
duplex
    Choices:
  • full
  • half
  • auto
Interface link status.
enabled
Interface link status.
mtu
Maximum size of transmit packet.
name
required
Name of the Interface.
neighbors
(added in 2.5)
Check the operational state of given interface name for LLDP neighbor.
The following suboptions are available.
host
LLDP neighbor host for given interface name.
port
LLDP neighbor port to which given interface name is connected.
provider Default:
None
Deprecated
Starting with Ansible 2.5 we recommend using connection: network_cli.
For more information please see the Network Guide.
A dict object containing connection details.
username
Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_USERNAME will be used instead.
host
required
Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport.
ssh_keyfile
Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_SSH_KEYFILE will be used instead.
timeout Default:
10
Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error.
password Default:
None
Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_PASSWORD will be used instead.
port Default:
22
Specifies the port to use when building the connection to the remote device.
speed
Interface link speed.
state
    Choices:
  • present
  • absent
  • up
  • down
State of the Interface configuration, up means present and operationally up and down means present and operationally down

Notes

Note

  • Tested against VYOS 1.1.7
  • For more information on using Ansible to manage network devices see the Ansible Network Guide

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

- name: Check lldp neighbors intent arguments
  vyos_interface:
    name: eth0
    neighbors:
    - port: eth0
      host: netdev

- name: Config + intent
  vyos_interface:
    name: eth1
    enabled: False
    state: down

Return Values

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

Key Returned Description
commands
list
always, except for the platforms that use Netconf transport to manage the device.
The list of configuration mode commands to send to 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']


Status

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

Support

For more information about Red Hat’s support of this module, please refer to this Knowledge Base article

Author

  • Ganesh Nalawade (@ganeshrn)

Hint

If you notice any issues in this documentation you can edit this document to improve it.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.5/modules/vyos_interface_module.html