Deprecated

Removed in None

i

Reason:Updated modules released with more functionality | Alternative:Use platform-specific "[netos]_l3_interfaces" module

ansible.netcommon.net_l3_interface (3.1.3) — module

(deprecated, removed after 2022-06-01) Manage L3 interfaces on network devices

| "added in version" 1.0.0 of ansible.netcommon"

Authors: Ricardo Carrillo Cruz (@rcarrillocruz)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install ansible.netcommon:==3.1.3


Add to requirements.yml

  collections:
    - name: ansible.netcommon
      version: 3.1.3

Description

This module provides declarative management of L3 interfaces on network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set eth0 IPv4 address
  ansible.netcommon.net_l3_interface:
    name: eth0
    ipv4: 192.168.0.1/24
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove eth0 IPv4 address
  ansible.netcommon.net_l3_interface:
    name: eth0
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set IP addresses on aggregate
  ansible.netcommon.net_l3_interface:
    aggregate:
    - name: eth1
      ipv4: 192.168.2.10/24
    - name: eth2
      ipv4: 192.168.3.10/24
      ipv6: fd5d:12c9:2201:1::1/64
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove IP addresses on aggregate
  ansible.netcommon.net_l3_interface:
    aggregate:
    - name: eth1
      ipv4: 192.168.2.10/24
    - name: eth2
      ipv4: 192.168.3.10/24
      ipv6: fd5d:12c9:2201:1::1/64
    state: absent

Inputs

    
ipv4:
    description:
    - IPv4 of the L3 interface.

ipv6:
    description:
    - IPv6 of the L3 interface.

name:
    description:
    - Name of the L3 interface.

purge:
    default: false
    description:
    - Purge L3 interfaces not defined in the I(aggregate) parameter.

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

aggregate:
    description: List of L3 interfaces definitions

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 address '192.168.0.1/24'
  type: list