• 博客
  • 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 命名空间中的集合
      • Community.Aws
        • 描述
        • 沟通
        • 变更日志
        • 插件索引
      • Community.Ciscosmb
      • Community.Crypto
      • Community.Digitalocean
      • Community.Dns
      • Community.Docker
      • Community.General
      • Community.Grafana
      • Community.Hashi_Vault
      • Community.Hrobot
      • Community.Library_Inventory_Filtering_V1
      • Community.Libvirt
      • Community.Mongodb
      • Community.Mysql
      • Community.Network
      • Community.Okd
      • Community.Postgresql
      • Community.Proxysql
      • Community.Rabbitmq
      • Community.Routeros
      • Community.Sap_Libs
      • Community.Sops
      • Community.Vmware
      • Community.Windows
      • Community.Zabbix
    • 容器命名空间中的集合
    • Cyberark 命名空间中的集合
    • Dellemc 命名空间中的集合
    • 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 参考:模块实用程序
  • 特殊变量
  • Red Hat Ansible Automation Platform
  • Ansible Automation Hub
  • 记录 Ansible 输出

路线图

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




Ansible
  • 集合索引
  • Community 命名空间中的集合
  • Community.Aws
  • community.aws.directconnect_link_aggregation_group 模块 – 管理 Direct Connect LAG 捆绑包
  • 在 GitHub 上编辑

community.aws.directconnect_link_aggregation_group 模块 – 管理 Direct Connect LAG 捆绑包

注意

此模块是 community.aws 集合 (版本 9.0.0) 的一部分。

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

要安装它,请使用:ansible-galaxy collection install community.aws。您需要其他要求才能使用此模块,请参阅 要求 以了解详细信息。

要在 playbook 中使用它,请指定:community.aws.directconnect_link_aggregation_group。

community.aws 1.0.0 中的新增功能

  • 概要

  • 要求

  • 参数

  • 备注

  • 示例

  • 返回值

概要

  • 创建、删除或修改 Direct Connect 链路聚合组。

  • 在 5.0.0 版本之前,此模块称为 community.aws.aws_direct_connect_link_aggregation_group。用法没有改变。

别名:aws_direct_connect_link_aggregation_group

要求

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

  • python >= 3.6

  • boto3 >= 1.28.0

  • botocore >= 1.31.0

参数

参数

注释

access_key

别名:aws_access_key_id,aws_access_key,ec2_access_key

字符串

AWS 访问密钥 ID。

有关访问令牌的更多信息,请参见 AWS 文档 https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys。

也可以使用 AWS_ACCESS_KEY_ID、AWS_ACCESS_KEY 或 EC2_ACCESS_KEY 环境变量,优先级依次递减。

aws_access_key 和 profile 选项互斥。

为与 AWS botocore SDK 保持一致,在 5.1.0 版本中添加了 aws_access_key_id 别名。

ec2_access_key 别名已弃用,将在 2024-12-01 之后的一个版本中删除。

EC2_ACCESS_KEY 环境变量的支持已弃用,将在 2024-12-01 之后的一个版本中删除。

aws_ca_bundle

路径

验证 SSL 证书时使用的 CA 捆绑包的位置。

也可以使用 AWS_CA_BUNDLE 环境变量。

aws_config

字典

用于修改 botocore 配置的字典。

参数可在 AWS 文档中找到 https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config。

bandwidth

字符串

链路聚合组的带宽。

connection_id

字符串

创建时要与链路聚合组链接的连接 ID。

debug_botocore_endpoint_logs

布尔值

使用 botocore.endpoint 日志记录器来解析在任务期间进行的唯一(而不是总计)"resource:action" API 调用,并将集合输出到任务结果中的 resource_actions 密钥。使用 aws_resource_action 回调将输出到 playbook 期间进行的总列表。

也可以使用 ANSIBLE_DEBUG_BOTOCORE_LOGS 环境变量。

选项

  • false ← (默认)

  • true

delete_with_disassociation

布尔值

与 state=absent 一起使用,以在将连接与 LAG 解关联后删除连接。

选项

  • false ← (默认)

  • true

endpoint_url

别名:ec2_url,aws_endpoint_url,s3_url

字符串

用于连接到默认 AWS 端点以外的 URL。虽然这可用于连接到其他与 AWS 兼容的服务,但 amazon.aws 和 community.aws 集合仅针对 AWS 进行了测试。

也可以使用 AWS_URL 或 EC2_URL 环境变量,优先级依次递减。

ec2_url 和 s3_url 别名已弃用,将在 2024-12-01 之后的一个版本中删除。

EC2_URL 环境变量的支持已弃用,将在 2024-12-01 之后的一个版本中删除。

force_delete

布尔值

这允许将最小链接数设置为 0,解关联任何托管连接,并删除与 LAG 关联的任何虚拟接口。

选项

  • false ← (默认)

  • true

link_aggregation_group_id

字符串

Direct Connect 链路聚合组的 ID。

location

字符串

链路聚合组的位置。

min_links

整数

LAG 本身必须运行的最小物理连接数。

name

字符串

Direct Connect 链路聚合组的名称。

num_connections

整数

用于初始化链路聚合组的连接数。

profile

别名:aws_profile

字符串

用于身份验证的命名 AWS 配置文件。

更多关于命名配置文件的信息,请参见 AWS 文档 https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html。

也可以使用 AWS_PROFILE 环境变量。

profile 选项与 aws_access_key、aws_secret_key 和 security_token 选项互斥。

region

别名:aws_region, ec2_region

字符串

要使用的 AWS 区域。

对于 IAM、Route53 和 CloudFront 等全球服务,将忽略 region。

也可以使用 AWS_REGION 或 EC2_REGION 环境变量。

更多信息,请参见 Amazon AWS 文档 http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region。

ec2_region 别名已弃用,将在 2024 年 12 月 1 日后的版本中移除。

对 EC2_REGION 环境变量的支持已弃用,将在 2024 年 12 月 1 日后的版本中移除。

secret_key

别名:aws_secret_access_key, aws_secret_key, ec2_secret_key

字符串

AWS 密钥。

有关访问令牌的更多信息,请参见 AWS 文档 https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys。

也可以按优先级递减的顺序使用 AWS_SECRET_ACCESS_KEY、AWS_SECRET_KEY 或 EC2_SECRET_KEY 环境变量。

secret_key 和 profile 选项互斥。

为了与 AWS botocore SDK 保持一致,在 5.1.0 版本中添加了 aws_secret_access_key 别名。

ec2_secret_key 别名已弃用,将在 2024 年 12 月 1 日后的版本中移除。

对 EC2_SECRET_KEY 环境变量的支持已弃用,将在 2024 年 12 月 1 日后的版本中移除。

session_token

别名:aws_session_token, security_token, aws_security_token, access_token

字符串

用于临时凭证的 AWS STS 会话令牌。

有关访问令牌的更多信息,请参见 AWS 文档 https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys。

也可以按优先级递减的顺序使用 AWS_SESSION_TOKEN、AWS_SECURITY_TOKEN 或 EC2_SECURITY_TOKEN 环境变量。

security_token 和 profile 选项互斥。

在 3.2.0 版本中添加了 aws_session_token 和 session_token 别名,在 6.0.0 版本中将参数名称从 security_token 重命名为 session_token。

security_token、aws_security_token 和 access_token 别名已弃用,将在 2024 年 12 月 1 日后的版本中移除。

对 EC2_SECRET_KEY 和 AWS_SECURITY_TOKEN 环境变量的支持已弃用,将在 2024 年 12 月 1 日后的版本中移除。

state

字符串 / 必需

Direct Connect 链路聚合组的状态。

选项

  • "present"

  • "absent"

validate_certs

布尔值

设置为 false 时,将不会验证与 AWS API 通信的 SSL 证书。

强烈建议不要设置 validate_certs=false,可以考虑改为设置 aws_ca_bundle。

选项

  • false

  • true ← (默认)

wait

布尔值

是否等待操作完成。

在等待虚拟接口删除时可能很有用。

可以通过设置 wait_timeout 来控制等待时间。

选项

  • false ← (默认)

  • true

wait_timeout

整数

如果 wait=true,则等待的持续时间(秒)。

默认: 120

备注

注意

  • 注意:对于模块,环境变量和配置文件是从 Ansible 的“主机”上下文而不是“控制器”上下文读取的。因此,可能需要将文件显式复制到“主机”。对于查找和连接插件,环境变量和配置文件是从 Ansible 的“控制器”上下文而不是“主机”上下文读取的。

  • Ansible 使用的 AWS SDK (boto3) 也可能从 Ansible “主机”上下文中的配置文件(通常为 ~/.aws/credentials)读取凭据和其他设置的默认值,例如区域。更多信息,请参见 https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html。

示例

# create a Direct Connect connection
- community.aws.directconnect_link_aggregation_group:
  state: present
  location: EqDC2
  lag_id: dxlag-xxxxxxxx
  bandwidth: 1Gbps

返回值

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

键

描述

aws_device

字符串

托管 LAG 的 AWS Direct Connect 端点。

返回:当 state=present 时

示例: "EqSe2-1bwfvazist2k0"

changed

字符串

LAG 是否已更改。

返回:始终

connections

列表 / 元素=字符串

此 LAG 捆绑的连接列表。

返回:当 state=present 时

示例: {"connections": [{"aws_device": "EqSe2-1bwfvazist2k0", "bandwidth": "1Gbps", "connection_id": "dxcon-fgzjah5a", "connection_name": "Requested Connection 1 for Lag dxlag-fgtoh97h", "connection_state": "down", "lag_id": "dxlag-fgnsp4rq", "location": "EqSe2", "owner_account": "123456789012", "region": "us-west-2"}]}

connections_bandwidth

字符串

LAG 捆绑的物理连接的单个带宽。

返回:当 state=present 时

示例: "1Gbps"

lag_id

字符串

链路聚合组的唯一标识符。

返回:当 state=present 时

示例: "dxlag-fgnsp4rq"

lag_name

字符串

用户为链路聚合组提供的名称。

返回:当 state=present 时

lag_state

字符串

LAG 的状态。

返回:当 state=present 时

示例: "pending"

location

字符串

连接所在的位置。

返回:当 state=present 时

示例: "EqSe2"

minimum_links

整数

LAG 本身必须运行的最小物理连接数。

返回:当 state=present 时

number_of_connections

整数

LAG 捆绑的物理连接数。

返回:当 state=present 时

owner_account

字符串

LAG 的所有者帐户 ID。

返回:当 state=present 时

region

字符串

LAG 所在的区域。

返回:当 state=present 时

作者

  • Sloane Hertel (@s-hertel)

集合链接

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

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