mellanox.onyx.onyx_interface module – Manage Interfaces on Mellanox ONYX network devices

Note

This module is part of the mellanox.onyx collection (version 1.0.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install mellanox.onyx.

To use it in a playbook, specify: mellanox.onyx.onyx_interface.

Synopsis

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

Parameters

Parameter

Comments

aggregate

string

List of Interfaces definitions.

delay

string

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.

Default: 10

description

string

Description of Interface.

duplex

string

Interface link status

Choices:

  • full

  • half

  • auto ← (default)

enabled

boolean

Interface link status.

Choices:

  • no

  • yes

mtu

string

Maximum size of transmit packet.

name

string / required

Name of the Interface.

purge

boolean

Purge Interfaces not defined in the aggregate parameter. This applies only for logical interface.

Choices:

  • no ← (default)

  • yes

rx_rate

string

Receiver rate in bits per second (bps).

This is state check parameter only.

Supports conditionals, see Conditionals in Networking Modules

speed

string

Interface link speed.

Choices:

  • 1G

  • 10G

  • 25G

  • 40G

  • 50G

  • 56G

  • 100G

state

string

State of the Interface configuration, up means present and operationally up and down means present and operationally down

Choices:

  • present ← (default)

  • absent

  • up

  • down

tx_rate

string

Transmit rate in bits per second (bps).

This is state check parameter only.

Supports conditionals, see Conditionals in Networking Modules

Examples

- name: Configure interface
  onyx_interface:
      name: Eth1/2
      description: test-interface
      speed: 100G
      mtu: 512

- name: Make interface up
  onyx_interface:
    name: Eth1/2
    enabled: True

- name: Make interface down
  onyx_interface:
    name: Eth1/2
    enabled: False

- name: Check intent arguments
  onyx_interface:
    name: Eth1/2
    state: up

- name: Config + intent
  onyx_interface:
    name: Eth1/2
    enabled: False
    state: down

Return Values

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

Key

Description

commands

list / elements=string

The list of configuration mode commands to send to the device.

Returned: always

Sample: [“interface ethernet 1/2”, “description test-interface”, “mtu 512”, “exit”]

Authors

  • Samer Deeb (@samerd)