arista.eos.eos_lacp_interfaces 模块 – LACP 接口资源模块

注意

此模块是 arista.eos 集合 (版本 10.0.1) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install arista.eos

要在 playbook 中使用它,请指定:arista.eos.eos_lacp_interfaces

arista.eos 1.0.0 中的新增功能

概要

  • 此模块管理 Arista EOS 设备上接口的链路聚合控制协议 (LACP) 属性。

参数

参数

注释

config

列表 / 元素=字典

LACP 接口选项的字典。

name

字符串

接口的全名(即 Ethernet1)。

port_priority

整数

接口的 LACP 端口优先级。范围 1-65535。

timer

别名:rate

字符串

LACP 发送 PDU 的速率。快速速率下,LACP 每 1 秒传输一次。正常速率下,在链路捆绑后,LACP 每 30 秒传输一次。

选项

  • "fast"

  • "normal"

running_config

字符串

此选项仅与 state parsed 一起使用。

此选项的值应是从 EOS 设备通过执行命令 **show running-config | section ^interfaces** 收到的输出。

state parsedrunning_config 选项读取配置并将其转换为 Ansible 结构化数据,符合资源模块的 argspec,然后该值将返回到结果中的 parsed 密钥中。

state

字符串

模块完成后的配置状态。

选项

  • "merged" ← (默认)

  • "replaced"

  • "overridden"

  • "deleted"

  • "parsed"

  • "rendered"

  • "gathered"

备注

注意

  • 针对 Arista EOS 4.24.6F 进行了测试

  • 此模块适用于连接 network_cli。请参见 EOS 平台选项

示例

# Using merged
#
#
# ------------
# Before state
# ------------
#
#
# veos#show run | section ^interface
# interface Ethernet1
#    lacp port-priority 30
# interface Ethernet2
#    lacp rate fast

- name: Merge provided configuration with device configuration
  arista.eos.eos_lacp_interfaces:
    config:
      - name: Ethernet1
        rate: fast
      - name: Ethernet2
        rate: normal
    state: merged

#
# -----------
# After state
# -----------
#
# veos#show run | section ^interface
# interface Ethernet1
#    lacp port-priority 30
#    lacp rate fast
# interface Ethernet2


# Using replaced
#
#
# ------------
# Before state
# ------------
#
# veos#show run | section ^interface
# interface Ethernet1
#    lacp port-priority 30
# interface Ethernet2
#    lacp rate fast

- name: Replace existing LACP configuration of specified interfaces with provided
    configuration
  arista.eos.eos_lacp_interfaces:
    config:
      - name: Ethernet1
        rate: fast
    state: replaced

#
# -----------
# After state
# -----------
#
# veos#show run | section ^interface
# interface Ethernet1
#    lacp rate fast
# interface Ethernet2
#    lacp rate fast


# Using overridden
#
#
# ------------
# Before state
# ------------
#
#
# veos#show run | section ^interface
# interface Ethernet1
#    lacp port-priority 30
# interface Ethernet2
#    lacp rate fast

- name: Override the LACP configuration of all the interfaces with provided configuration
  arista.eos.eos_lacp_interfaces:
    config:
      - name: Ethernet1
        rate: fast
    state: overridden

#
# -----------
# After state
#
#
# veos#show run | section ^interface
# interface Ethernet1
#    lacp rate fast
# interface Ethernet2


# Using deleted
#
#
# ------------
# Before state
# ------------
#
#
# veos#show run | section ^interface
# interface Ethernet1
#    lacp port-priority 30
# interface Ethernet2
#    lacp rate fast

- name: Delete LACP attributes of given interfaces (or all interfaces if none specified).
  arista.eos.eos_lacp_interfaces:
    state: deleted

#
# -----------
# After state
# -----------
#
# veos#show run | section ^interface
# interface Ethernet1
# interface Ethernet2

# using rendered:

- name: Use Rendered to convert the structured data to native config
  arista.eos.eos_lacp_interfaces:
    config:
      - name: Ethernet1
        rate: fast
      - name: Ethernet2
        rate: normal
    state: rendered

#
# -----------
# Output
# -----------
# rendered:
#   - "interface Ethernet1"
#   - "lacp rate fast"

# Using parsed:

# parsed.cfg:
#    "interface Ethernet1"
#    "lacp rate fast"
#    "interface Ethernet2"

- name: Use parsed to convert native configs to structured data
  arista.eos.eos_lacp_interfaces:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Output:
# parsed:
#   - name: Ethernet1
#     rate: fast
#   - name: Ethernet2
#     rate: normal

# Using gathered:
# native config:
#  veos#show run | section ^interface
# interface Ethernet1
#    lacp port-priority 30
# interface Ethernet2
#    lacp rate fast

- name: Gather LACP facts from the device
  arista.eos.eos_lacp_interfaces:
    state: gathered

# Output:
# gathered:
#   - name: Ethernet1
#   - name: Ethernet2
#     rate: fast

返回值

常见的返回值已在 此处 记录,以下是此模块特有的字段

描述

after

列表 / 元素=字符串

模块完成后的配置,以结构化数据形式表示。

返回:发生更改时

示例: ["The configuration returned will always be in the same format\n of the parameters above.\n"]

before

列表 / 元素=字符串

模块调用前的配置,以结构化数据形式表示。

返回:始终返回

示例: ["The configuration returned will always be in the same format\n of the parameters above.\n"]

commands

列表 / 元素=字符串

推送到远程设备的命令集。

返回:始终返回

示例: ["interface Ethernet1", "lacp rate fast"]

作者

  • Nathaniel Case (@Qalthos)