arista.eos.eos_lacp 模块 – LACP 资源模块

注意

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

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

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

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

arista.eos 1.0.0 中的新增功能

概要

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

参数

参数

注释

config

字典

LACP 全局选项。

system

字典

LACP 系统选项。

priority

整数

在 LACP 协商中使用的系统优先级。

值越小,优先级越高。

请参考厂商文档以获取有效值。

running_config

字符串

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

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

state *parsed* 从 running_config 选项读取配置并将其转换为 Ansible 结构化数据,然后根据资源模块的 argspec 将值返回到结果中的 *parsed* 键中。

state

字符串

模块完成后的配置状态。

选项

  • "merged" ← (默认)

  • "replaced"

  • "deleted"

  • "parsed"

  • "rendered"

  • "gathered"

注释

注意

  • 针对 Arista EOS 4.24.6F 测试

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

示例

# Using merged

# Before state:
# -------------
# veos# show running-config | include lacp
# lacp system-priority 10

- name: Merge provided global LACP attributes with device attributes
  arista.eos.eos_lacp:
    config:
      system:
        priority: 20
    state: merged

# After state:
# ------------
# veos# show running-config | include lacp
# lacp system-priority 20
#


# Using replaced

# Before state:
# -------------
# veos# show running-config | include lacp
# lacp system-priority 10

- name: Replace device global LACP attributes with provided attributes
  arista.eos.eos_lacp:
    config:
      system:
        priority: 20
    state: replaced

# After state:
# ------------
# veos# show running-config | include lacp
# lacp system-priority 20
#


# Using deleted

# Before state:
# -------------
# veos# show running-config | include lacp
# lacp system-priority 10

- name: Delete global LACP attributes
  arista.eos.eos_lacp:
    state: deleted

# After state:
# ------------
# veos# show running-config | include lacp
#

# Using rendered:

- name: Use Rendered to convert the structured data to native config
  arista.eos.eos_lacp:
    config:
      system:
        priority: 20
    state: rendered

# Output:
# ------------
# rendered:
#   - "lacp system-priority 20"
#

# Using parsed:

# parsed.cfg
# lacp system-priority 20

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

# Output:
# parsed:
#   system:
#     priority: 20

# Using gathered:
# nathive config:
# -------------
# lacp system-priority 10

- name: Gather lacp facts from the device
  arista.eos.eos_lacp:
    state: gathered

# Output:
# gathered:
#   system:
#     priority: 10
#

返回值

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

描述

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

列表 / 元素=字符串

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

返回:始终

示例: ["lacp system-priority 10"]

作者

  • Nathaniel Case (@Qalthos)