• 博客
  • 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 命名空间中的集合
    • F5networks 命名空间中的集合
    • Fortinet 命名空间中的集合
    • Frr 命名空间中的集合
    • Gluster 命名空间中的集合
    • Google 命名空间中的集合
    • Grafana 命名空间中的集合
    • Hetzner 命名空间中的集合
    • Hpe 命名空间中的集合
    • Ibm 命名空间中的集合
    • Ieisystem 命名空间中的集合
    • Infinidat 命名空间中的集合
    • Infoblox 命名空间中的集合
    • Inspur 命名空间中的集合
    • Junipernetworks 命名空间中的集合
      • Junipernetworks.Junos
        • 描述
        • 插件索引
    • 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 参考:模块实用程序
  • 特殊变量
  • Red Hat Ansible Automation Platform
  • Ansible Automation Hub
  • 记录 Ansible 输出

路线图

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




Ansible
  • 集合索引
  • Junipernetworks 命名空间中的集合
  • Junipernetworks.Junos
  • junipernetworks.junos.junos_lacp 模块 – 全局链路聚合控制协议 (LACP) Junos 资源模块


junipernetworks.junos.junos_lacp 模块 – 全局链路聚合控制协议 (LACP) Junos 资源模块

注意

此模块是 junipernetworks.junos 集合 (版本 9.1.0) 的一部分。

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

要安装它,请使用:ansible-galaxy collection install junipernetworks.junos。您需要其他要求才能使用此模块,有关详细信息,请参见 要求。

要在 playbook 中使用它,请指定:junipernetworks.junos.junos_lacp。

junipernetworks.junos 1.0.0 中的新增功能

  • 摘要

  • 要求

  • 参数

  • 备注

  • 示例

  • 返回值

摘要

  • 此模块提供对 Juniper Junos 网络设备上全局 LACP 的声明式管理。

要求

执行此模块的主机需要以下要求。

  • ncclient (>=v0.6.4)

参数

参数

注释

config

字典

LACP 全局选项的字典

link_protection

字符串

为系统启用 LACP 链路保护。如果该值设置为 non-revertive,则当出现优先级更高的链路时,它不会恢复链路。默认情况下,链路将被恢复。

选项

  • "revertive"

  • "non-revertive"

system_priority

整数

系统的 LACP 优先级。

running_config

字符串

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

此选项的值应为通过执行命令 **show chassis aggregated-devices ethernet lacp** 从 Junos 设备接收的输出。

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

state

字符串

模块完成后的配置状态

选项

  • "merged" ← (默认)

  • "replaced"

  • "deleted"

  • "gathered"

  • "rendered"

  • "parsed"

备注

注意

  • 此模块要求在被管理的远程设备上启用 netconf 系统服务。

  • 针对 vSRX JUNOS 版本 18.1R1 进行了测试。

  • 此模块与连接 netconf 配合使用。请参见 Junos OS 平台选项。

示例

# Using deleted

# Before state:
# -------------
# user@junos01# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection {
#    non-revertive;
# }

- name: Delete global LACP attributes
  junipernetworks.junos.junos_lacp:
    state: deleted

# After state:
# ------------
# user@junos01# show chassis aggregated-devices ethernet lacp
#


# Using merged

# Before state:
# -------------
# user@junos01# show chassis aggregated-devices ethernet lacp
#

- name: Merge global LACP attributes
  junipernetworks.junos.junos_lacp:
    config:
      system_priority: 63
      link_protection: revertive
    state: merged

# After state:
# ------------
# user@junos01# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection {
#    non-revertive;
# }


# Using replaced

# Before state:
# -------------
# user@junos01# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection {
#    non-revertive;
# }

- name: Replace global LACP attributes
  junipernetworks.junos.junos_lacp:
    config:
      system_priority: 30
      link_protection: non-revertive
    state: replaced

# After state:
# ------------
# user@junos01# show chassis aggregated-devices ethernet lacp
# system-priority 30;
# link-protection;
#
# Using gathered
# Before state:
# ------------
#
# ansible@cm123456tr21# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection;

- name: Gather junos lacp as in given arguments
  junipernetworks.junos.junos_lacp:
    state: gathered
# Task Output (redacted)
# -----------------------
#
# "gathered": {
#         "link_protection": "revertive",
#         "system_priority": 63
#     }
# After state:
# ------------
#
# ansible@cm123456tr21# show chassis aggregated-devices ethernet lacp
# system-priority 63;
# link-protection;
# Using rendered
- name: Render platform specific xml from task input using rendered state
  junipernetworks.junos.junos_lacp:
    config:
      system_priority: 63
      link_protection: revertive
    state: rendered
# Task Output (redacted)
# -----------------------
# "rendered": "<nc:chassis
#     xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
#     <nc:aggregated-devices>
#         <nc:ethernet>
#             <nc:lacp>
#                 <nc:system-priority>63</nc:system-priority>
#                 <nc:link-protection>
#                     <nc:non-revertive delete="delete"/>
#                 </nc:link-protection>
#             </nc:lacp>
#         </nc:ethernet>
#     </nc:aggregated-devices>
# </nc:chassis>
#
# Using parsed
# parsed.cfg
# ------------
#
# <?xml version="1.0" encoding="UTF-8"?>
# <rpc-reply message-id="urn:uuid:0cadb4e8-5bba-47f4-986e-72906227007f">
#     <configuration changed-seconds="1590139550" changed-localtime="2020-05-22 09:25:50 UTC">
#     <chassis>
#         <aggregated-devices>
#             <ethernet>
#                 <lacp>
#                     <system-priority>63</system-priority>
#                     <link-protection>
#                     </link-protection>
#                 </lacp>
#             </ethernet>
#         </aggregated-devices>
#     </chassis>
#     </configuration>
# </rpc-reply>
# - name: Convert lacp config to argspec without connecting to the appliance
#   junipernetworks.junos.junos_lacp:
#     running_config: "{{ lookup('file', './parsed.cfg') }}"
#     state: parsed
# Task Output (redacted)
# -----------------------
# "parsed": {
#         "link_protection": "revertive",
#         "system_priority": 63
#     }

返回值

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

键

描述

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"

xml

列表 / 元素=字符串

推送到远程设备的 xml rpc 有效负载集。

返回:始终

示例: ["<nc:chassis xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\"> <nc:aggregated-devices> <nc:ethernet> <nc:lacp> <nc:system-priority>63</nc:system-priority> <nc:link-protection> <nc:non-revertive delete=\"delete\"/> </nc:link-protection> </nc:lacp> </nc:ethernet> </nc:aggregated-devices> </nc:chassis>", "xml 2", "xml 3"]

作者

  • Ganesh Nalawade (@ganeshrn)

集合链接

  • 问题跟踪器
  • 代码库 (源代码)
上一页 下一页

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