• 博客
  • Ansible 社区论坛
  • 文档
Ansible Logo
Ansible 社区文档
Ansible

Ansible 入门

  • Ansible 入门
  • 执行环境入门

安装、升级和配置

  • 安装指南
  • Ansible 移植指南

使用 Ansible

  • 构建 Ansible 清单
  • 使用 Ansible 命令行工具
  • 使用 Ansible Playbook
  • 使用 Ansible Vault 保护敏感数据
  • 使用 Ansible 模块和插件
  • 使用 Ansible 集合
  • 在 Windows 和 BSD 上使用 Ansible
  • Ansible 技巧和窍门

为 Ansible 做贡献

  • Ansible 社区指南
  • Ansible 集合贡献者指南
  • ansible-core 贡献者指南
  • 高级贡献者指南
  • Ansible 文档风格指南

扩展 Ansible

  • 开发者指南

常见的 Ansible 场景

  • 旧版公有云指南

网络自动化

  • 网络入门
  • 网络高级主题
  • 网络开发者指南

Ansible Galaxy

  • Galaxy 用户指南
  • Galaxy 开发者指南

参考 & 附录

  • 集合索引
    • Amazon 命名空间中的集合
    • Ansible 命名空间中的集合
    • Arista 命名空间中的集合
    • Awx 命名空间中的集合
    • Azure 命名空间中的集合
    • Check_point 命名空间中的集合
    • Chocolatey 命名空间中的集合
    • Cisco 命名空间中的集合
    • Cloud 命名空间中的集合
    • Cloudscale_ch 命名空间中的集合
    • Community 命名空间中的集合
    • Containers 命名空间中的集合
    • Cyberark 命名空间中的集合
    • Dellemc 命名空间中的集合
      • Dellemc.Enterprise_Sonic
        • 描述
        • 插件索引
      • Dellemc.Openmanage
      • Dellemc.Powerflex
      • Dellemc.Unity
    • F5networks 命名空间中的集合
    • Fortinet 命名空间中的集合
    • Frr 命名空间中的集合
    • Gluster 命名空间中的集合
    • Google 命名空间中的集合
    • Grafana 命名空间中的集合
    • Hetzner 命名空间中的集合
    • Hpe 命名空间中的集合
    • Ibm 命名空间中的集合
    • Ieisystem 命名空间中的集合
    • Infinidat 命名空间中的集合
    • Infoblox 命名空间中的集合
    • Inspur 命名空间中的集合
    • Junipernetworks 命名空间中的集合
    • Kaytus 命名空间中的集合
    • Kubernetes 命名空间中的集合
    • Kubevirt 命名空间中的集合
    • Lowlydba 命名空间中的集合
    • Mellanox 命名空间中的集合
    • Microsoft 命名空间中的集合
    • Netapp 命名空间中的集合
    • Netapp_eseries 命名空间中的集合
    • Netbox 命名空间中的集合
    • Ngine_io 命名空间中的集合
    • Openstack 命名空间中的集合
    • Openvswitch 命名空间中的集合
    • Ovirt 命名空间中的集合
    • Purestorage 命名空间中的集合
    • Sensu 命名空间中的集合
    • Servicenow 命名空间中的集合
    • Splunk 命名空间中的集合
    • T_systems_mms 命名空间中的集合
    • Telekom_mms 命名空间中的集合
    • Theforeman 命名空间中的集合
    • Vmware 命名空间中的集合
    • Vultr 命名空间中的集合
    • Vyos 命名空间中的集合
    • Wti 命名空间中的集合
  • 所有模块和插件的索引
  • Playbook 关键字
  • 返回值
  • Ansible 配置设置
  • 控制 Ansible 的行为方式:优先级规则
  • YAML 语法
  • Python 3 支持
  • 解释器发现
  • 发布和维护
  • 测试策略
  • 健全性测试
  • 常见问题解答
  • 词汇表
  • Ansible 参考:模块实用程序
  • 特殊变量
  • 红帽 Ansible 自动化平台
  • Ansible Automation Hub
  • 记录 Ansible 输出

路线图

  • Ansible 路线图
  • ansible-core 路线图




Ansible
  • 集合索引
  • Dellemc 命名空间中的集合
  • Dellemc.Enterprise_Sonic
  • dellemc.enterprise_sonic.sonic_lag_interfaces 模块 – 管理链路聚合组 (LAG) 接口参数


dellemc.enterprise_sonic.sonic_lag_interfaces 模块 – 管理链路聚合组 (LAG) 接口参数

注意

此模块是 dellemc.enterprise_sonic 集合(版本 2.5.1)的一部分。

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

要安装它,请使用:ansible-galaxy collection install dellemc.enterprise_sonic。

要在 playbook 中使用它,请指定:dellemc.enterprise_sonic.sonic_lag_interfaces。

dellemc.enterprise_sonic 1.0.0 中的新功能

  • 概要

  • 参数

  • 注释

  • 示例

  • 返回值

概要

  • 此模块管理运行 Dell Technologies 的 Enterprise SONiC 发行版的设备的链路聚合组 (LAG) 接口的属性。

注意

此模块具有相应的 操作插件。

参数

参数

注释

config

列表 / elements=字典

LAG 配置的列表。

ethernet_segment

字典

在 dellemc.enterprise_sonic 2.5.0 中添加

指定以太网段。

df_preference

整数

指定转发器选举方法的首选项。 df_preference 值的范围为 1 到 65535。

esi

字符串

指定以太网段标识符的值。对于 auto_lacp 和 auto_system_mac,仅支持“AUTO”。

esi_type

字符串 / 必需

指定以太网段标识符的类型。 esi_type 和 esi 不能单独删除。如果 esi 和 df_preference 都不存在,则删除状态将删除整个以太网段。

选项

  • “auto_lacp”

  • “auto_system_mac”

  • “ethernet_segment_id”

members

字典

作为该组一部分的接口列表。

interfaces

列表 / elements=字典

作为该组一部分的接口列表。

member

字符串

接口名称。

mode

字符串

指定创建时端口通道的模式。

选项

  • “static”

  • “lacp”

name

字符串 / 必需

LAG 的 ID。

state

字符串

配置应保留的状态。

选项

  • "merged" ←(默认)

  • “replaced”

  • “overridden”

  • “deleted”

注释

注意

  • 针对 Dell Technologies 的 Enterprise SONiC 发行版进行了测试。

  • 支持 check_mode。

示例

# Using merged
#
# Before state:
# -------------
#
# interface Eth1/10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  no shutdown
#
- name: Merges provided configuration with device configuration
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config:
     - name: PortChannel10
       members:
         interfaces:
           - member: Eth1/10
       ethernet_segment:
         esi_type: auto_lacp
         df_preference: 2222
     - name: PortChannel12
       members:
         interfaces:
           - member: Eth1/15
    state: merged
#
# After state:
# ------------
#
# interface Eth1/10
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/15
#  channel-group 12
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  no shutdown
#  !
#  evpn ethernet-segment auto-lacp
#  df-preference 2222
# !
# interface PortChannel12
#  no shutdown
#
#
# Using replaced
#
# Before state:
# -------------
#
# interface Eth1/5
#   channel-group 10
#   mtu 9100
#   speed 100000
#   no shutdown
# !
# interface Eth1/7
#   no channel-group
#   mtu 9100
#   speed 100000
#   no shutdown
# !
# interface PortChannel10
#  no shutdown
#  !
#  evpn ethernet-segment auto-lacp
#   df-preference 2222
#
- name: Replace device configuration of specified LAG attributes
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config:
      - name: PortChannel20
        members:
          interfaces:
            - member: Eth1/6
        ethernet_segment:
          esi_type: auto_system_mac
          df_preference: 6666
      - name: PortChannel10
        members:
          interfaces:
            - member: Eth1/7
        ethernet_segment:
          esi_type: auto_system_mac
          df_preference: 3333
    state: replaced
#
# After state:
# ------------
#
# interface Eth1/5
#   mtu 9100
#   speed 100000
#   no shutdown
#
# interface Eth1/6
#   channel-group 20
#   mtu 9100
#   speed 100000
#   no shutdown
#
# interface Eth1/7
#   channel-group 10
#   mtu 9100
#   speed 100000
#   no shutdown
#
# interface PortChannel10
#  no shutdown
#  !
#  evpn ethernet-segment auto-system-mac
#   df-preference 3333
#
# interface PortChanne20
#  no shutdown
#  !
#  evpn ethernet-segment auto-system-mac
#   df-preference 6666
#
# Using overridden
#
# Before state:
# -------------
#
# interface Eth1/5
#   channel-group 10
#   mtu 9100
#   speed 100000
#   no shutdown
#
# interface Eth1/6
#   no channel-group
#   mtu 9100
#   speed 100000
#   no shutdown
#
# interface PortChannel10
#   no shutdown
#   !
#   evpn ethernet-segment auto-system-mac
#    df-preference 2222
#
- name: Override device configuration of all LAG attributes
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config:
      - name: PortChannel20
        members:
          interfaces:
            - member: Eth1/6
        ethernet_segment:
          esi_type: auto_lacp
          df_preference: 3333
    state: overridden
#
# After state:
# ------------
#
# interface Eth1/5
#   mtu 9100
#   speed 100000
#   no shutdown
#
# interface Eth1/6
#   channel-group 20
#   mtu 9100
#   speed 100000
#   no shutdown
#
# interface PortChannel20
#  no shutdown
#  !
#  evpn ethernet-segment auto-lacp
#   df-preference 3333
#
# Using deleted
#
# Before state:
# -------------
# interface PortChannel 10
#  no shutdown
#  !
#  evpn ethernet-segment auto-lacp
#   df-preference 2222
# !
# interface PortChannel 12
# !
# interface Eth1/10
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/15
#  channel-group 12
#  mtu 9100
#  speed 100000
#  no shutdown
#
- name: Deletes all LAGs and LAG attributes of all interfaces
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config:
    state: deleted
#
# After state:
# -------------
#
# interface Eth1/10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/15
#  mtu 9100
#  speed 100000
#  no shutdown
#
# Using deleted
#
# Before state:
# -------------
# interface Eth1/10
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  no shutdown
#  !
#  evpn ethernet-segment auto-lacp
#   df-preference 2222
#
- name: Deletes some LAGs and LAG attributes.
  sonic_lag_interfaces:
    config:
      - name: PortChannel10
        members:
          interfaces:
            - member: Eth1/10
        ethernet_segment:
          esi_type: auto_lacp
    state: deleted
#
# After state:
# -------------
#
# interface Eth1/10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  no shutdown
#  !
#

返回值

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

键

描述

after

列表 / elements=字符串

生成的配置模块调用。

返回: 当更改时

示例: ["返回的配置始终与上面的参数格式相同。\n"]

before

列表 / elements=字符串

模块调用之前的配置。

返回: 始终

示例: ["返回的配置始终与上面的参数格式相同。\n"]

commands

列表 / elements=字符串

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

返回: 始终

示例: ["命令 1", "命令 2", "命令 3"]

作者

  • Abirami N (@abirami-n)

集合链接

  • 问题跟踪器
  • 存储库(源)
上一个 下一个

© 版权所有 Ansible 项目贡献者。 最后更新于 2024 年 12 月 19 日。