cisco.ios.ios_lacp 模块 – 配置 LACP 的资源模块。
注意
此模块是 cisco.ios 集合 (版本 9.0.3) 的一部分。
如果您使用的是 ansible
软件包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install cisco.ios
。
要在 playbook 中使用它,请指定: cisco.ios.ios_lacp
。
cisco.ios 1.0.0 中的新增功能
概要
此模块提供对 Cisco IOS 网络设备上全局 LACP 的声明式管理。
参数
参数 |
注释 |
---|---|
提供的配置。 |
|
此选项设置 LACP 的默认系统参数。 |
|
系统的 LACP 优先级。 请参考供应商文档以了解有效值。 |
|
此选项仅与状态 parsed 一起使用。 此选项的值应是从 IOS 设备通过执行命令 show lacp sys-id 收到的输出。 状态 parsed 从 |
|
配置应保留的状态 该模块对替换和覆盖状态具有声明式类似的行为。 状态 rendered、gathered 和 parsed 不会对设备进行任何更改。 状态 rendered 将 状态 gathered 将从设备获取运行配置,并根据资源模块 argspec 将其转换为结构化数据,该值将返回结果中的 gathered 键中。 状态 parsed 从 选项
|
备注
注意
在 CML 上针对 Cisco IOS XE 版本 17.3 进行了测试。
此模块与连接
network_cli
一起使用。请参见 https://docs.ansible.org.cn/ansible/latest/network/user_guide/platform_ios.html
示例
# Using merged
#
# Before state:
# -------------
#
# vios#show lacp sys-id
# 32768, 5e00.0000.8000
- name: Merge provided configuration with device configuration
cisco.ios.ios_lacp:
config:
system:
priority: 123
state: merged
# After state:
# ------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000
# Using replaced
#
# Before state:
# -------------
#
# vios#show lacp sys-id
# 500, 5e00.0000.8000
- name: Replaces Global LACP configuration
cisco.ios.ios_lacp:
config:
system:
priority: 123
state: replaced
# After state:
# ------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000
# Using Deleted
#
# Before state:
# -------------
#
# vios#show lacp sys-id
# 500, 5e00.0000.8000
- name: Delete Global LACP attribute
cisco.ios.ios_lacp:
state: deleted
# After state:
# -------------
#
# vios#show lacp sys-id
# 32768, 5e00.0000.8000
# Using Gathered
# Before state:
# -------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000
- name: Gather listed LACP with provided configurations
cisco.ios.ios_lacp:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "system": {
# "priority": 500
# }
# }
# After state:
# ------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_lacp:
config:
system:
priority: 123
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "lacp system-priority 10"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# lacp system-priority 123
- name: Parse the commands for provided configuration
cisco.ios.ios_lacp:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "system": {
# "priority": 123
# }
# }
返回值
常见的返回值已在 此处 记录,以下是此模块特有的字段
键 |
描述 |
---|---|
模块完成后的结构化数据配置。 返回:已更改时 示例: |
|
模块调用之前的结构化数据配置。 返回:始终 示例: |
|
推送到远程设备的命令集。 返回:始终 示例: |