cisco.iosxr.iosxr_lacp 模块 – 配置 LACP 的资源模块。
注意
此模块是 cisco.iosxr 集合 (版本 10.2.2) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install cisco.iosxr
。
要在 playbook 中使用它,请指定: cisco.iosxr.iosxr_lacp
。
cisco.iosxr 1.0.0 中的新增功能
概要
此模块管理 IOS-XR 设备上的全局链路聚合控制协议 (LACP)。
参数
参数 |
注释 |
---|---|
提供的配置。 |
|
此选项设置 LACP 捆绑的默认系统参数。 |
|
LACP 的系统 MAC 相关配置。 |
|
在 LACP 协商中使用的系统 ID。 |
|
在 LACP 协商中使用的系统优先级。 较低的值表示较高的优先级。 请参考供应商文档以了解有效值。 |
|
此选项仅与 state *parsed* 一起使用。 此选项的值应是从 IOS-XR 设备执行命令 **show running-config lacp** 收到的输出。 state *parsed* 从 |
|
模块完成后的配置状态。 选项
|
注释
注意
此模块与连接
network_cli
配合使用。请参见 IOS-XR 平台选项。
示例
# Using merged
#
#
# ------------
# Before state
# ------------
#
#
# RP/0/0/CPU0:iosxr01#show running-config lacp
# Tue Jul 16 17:46:08.147 UTC
# % No such configuration item(s)
#
#
- name: Merge provided configuration with device configuration
cisco.iosxr.iosxr_lacp:
config:
system:
priority: 10
mac:
address: 00c1.4c00.bd15
state: merged
#
#
# -----------------------
# Module Execution Result
# -----------------------
#
# "before": {}
#
#
# "commands": [
# "lacp system priority 10",
# "lacp system mac 00c1.4c00.bd15"
# ]
#
#
# "after": {
# "system": {
# "mac": {
# "address": "00c1.4c00.bd15"
# },
# "priority": 10
# }
# }
#
# -----------
# After state
# -----------
#
#
# RP/0/0/CPU0:iosxr01#sh run lacp
# Tue Jul 16 17:51:29.365 UTC
# lacp system mac 00c1.4c00.bd15
# lacp system priority 10
#
#
# Using replaced
#
#
# -------------
# Before state
# -------------
#
#
# RP/0/0/CPU0:iosxr01#sh run lacp
# Tue Jul 16 17:53:59.904 UTC
# lacp system mac 00c1.4c00.bd15
# lacp system priority 10
#
- name: Replace device global lacp configuration with the given configuration
cisco.iosxr.iosxr_lacp:
config:
system:
priority: 11
state: replaced
#
#
# -----------------------
# Module Execution Result
# -----------------------
# "before": {
# "system": {
# "mac": {
# "address": "00c1.4c00.bd15"
# },
# "priority": 10
# }
# }
#
#
# "commands": [
# "no lacp system mac",
# "lacp system priority 11"
# ]
#
#
# "after": {
# "system": {
# "priority": 11
# }
# }
#
# -----------
# After state
# -----------
#
#
# RP/0/0/CPU0:iosxr01#sh run lacp
# Tue Jul 16 18:02:40.379 UTC
# lacp system priority 11
#
#
# Using deleted
#
#
# ------------
# Before state
# ------------
#
#
# RP/0/0/CPU0:iosxr01#sh run lacp
# Tue Jul 16 18:37:09.727 UTC
# lacp system mac 00c1.4c00.bd15
# lacp system priority 11
#
#
- name: Delete global LACP configurations from the device
cisco.iosxr.iosxr_lacp:
state: deleted
#
#
# -----------------------
# Module Execution Result
# -----------------------
# "before": {
# "system": {
# "mac": {
# "address": "00c1.4c00.bd15"
# },
# "priority": 11
# }
# }
#
#
# "commands": [
# "no lacp system mac",
# "no lacp system priority"
# ]
#
#
# "after": {}
#
# ------------
# After state
# ------------
#
#
# RP/0/0/CPU0:iosxr01#sh run lacp
# Tue Jul 16 18:39:44.116 UTC
# % No such configuration item(s)
#
#
# Using parsed
# parsed.cfg
# ------------
#
# lacp system mac 00c1.4c00.bd15
# lacp system priority 11
# - name: Convert LACP config to argspec without connecting to the appliance
# cisco.iosxr.iosxr_lacp:
# running_config: "{{ lookup('file', './parsed.cfg') }}"
# state: parsed
# Task Output (redacted)
# -----------------------
# "parsed": {
# "system": {
# "mac": {
# "address": "00c1.4c00.bd15"
# },
# "priority": 11
# }
# }
# Using rendered
- name: Render platform specific commands from task input using rendered state
cisco.iosxr.iosxr_lacp:
config:
system:
priority: 11
mac:
address: 00c1.4c00.bd15
state: rendered
# Task Output (redacted)
# -----------------------
# "rendered": [
# "lacp system priority 11",
# "lacp system mac 00c1.4c00.bd15"
# ]
# Using gathered
# Before state:
# ------------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config lacp
# lacp system mac 00c1.4c00.bd15
# lacp system priority 11
- name: Gather IOSXR LACP configuration
cisco.iosxr.iosxr_lacp:
config:
state: gathered
# Task Output (redacted)
# -----------------------
#
# "gathered": {
# "system": {
# "mac": {
# "address": "00c1.4c00.bd15"
# },
# "priority": 11
# }
# }
# After state:
# ------------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config lacp
# lacp system mac 00c1.4c00.bd15
# lacp system priority
返回值
常用的返回值已在 此处 记录,以下是此模块特有的字段
键 |
描述 |
---|---|
模块完成后的结构化数据配置。 返回:已更改时 示例: |
|
模块调用之前的结构化数据配置。 返回:始终返回 示例: |
|
推送到远程设备的命令集。 返回:始终返回 示例: |