cisco.aci.aci_l3out_bgp_peer 模块 – 管理三层外部 (L3Out) BGP 对等体 (bgp:PeerP 和 bgp:InfraPeerP)
注意
此模块是 cisco.aci 集合(版本 2.10.1)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install cisco.aci。
要在剧本中使用它,请指定:cisco.aci.aci_l3out_bgp_peer。
概要
- 在 Cisco ACI 结构上管理 L3Out BGP 对等体。 
参数
| 参数 | 注释 | 
|---|---|
| 地址类型控制 选项 
 | |
| BGP 会话的管理状态 选项 
 | |
| 允许的自 AS 的数量。 仅当在  | |
| 用于注释对象的用户定义字符串。 如果在任务中未指定该值,则将使用环境变量  如果在任务和环境变量  默认值:  | |
| BGP 控制 选项 
 | |
| BGP 基础结构对等体 (bgp:InfraPeerP)。 选项 
 | |
| BGP 对等体的密码。 提供密码将始终导致更改,因为无法从 APIC 检索设置的密码。 | |
| BGP 对等体前缀策略。 仅当 *bgp_infra_peer=true* 时,才允许配置 BGP 对等体前缀策略。 | |
| 附加到用于基于签名的身份验证的 APIC AAA 用户的 X.509 证书名称。 如果提供了  如果为  如果在任务中未指定该值,则将使用环境变量  | |
| BGP 对等体的描述。 | |
| Ansible 控制主机可解析的 APIC 的 IP 地址或主机名。 如果在任务中未指定该值,则将使用环境变量  | |
| 接口配置文件的名称。 | |
| 现有 L3Out 的名称。 | |
| L3Out BGP 对等体的本地自治系统号 (ASN)。 在创建期间未设置时,APIC 默认为 0。 | |
| L3Out BGP 对等体的本地自治系统号 (ASN) 配置。 在创建期间未设置时,APIC 默认为  选项 
 | |
| 在端口通道和单个端口上构建接口的节点。 用于 vPC 的以连字符分隔的节点对(例如“201-202”)。 | |
| 节点配置文件的名称。 | |
| 影响此 ACI 模块的输出。 
 
 
 如果在任务中未指定该值,则将使用环境变量  选项 
 | |
| 用于转储模块生成的 ACI JSON 配置对象的文件路径。 如果在任务中未指定该值,则将使用环境变量  | |
| 用于身份验证的密码。 此选项与  如果任务中未指定该值,则将使用环境变量  | |
| 接口路径 端口通道和 vPC 的接口端口组名称 单端口的端口号(例如“eth1/12”) | |
| 对等控制 选项 
 | |
| BGP 对等方的 IP 地址。 | |
| BGP 对等方类型。 选项 
 | |
| 要在其上构建接口的 Pod。 | |
| 用于 REST 连接的端口号。 默认值取决于参数  如果任务中未指定该值,则将使用环境变量  | |
| 私有 AS 控制 选项 
 | |
| 用于基于签名的身份验证的 PEM 格式的私钥文件或私钥内容。 此值还会影响使用的默认  此选项与  如果任务中未指定该值,则将使用环境变量  | |
| BGP 对等方的自治系统号。 | |
| 用于将 BGP 对等连接配置文件绑定到路由控制配置文件的字典对象列表。 | |
| 路由控制配置文件的方向名称。 | |
| L3 Out 的名称。 | |
| 路由控制配置文件的名称。 | |
| 租户的名称。 | |
| 使用  使用  选项 
 | |
| 如果为  如果任务中未指定该值,则将使用环境变量  默认值为  警告 - 这会导致之前的返回值为空。 将不会检查对象的先前状态,并且 POST 更新将包含所有属性。 选项 
 | |
| 如果为  如果任务中未指定该值,则将使用环境变量  默认值为  警告 - 这会导致当前返回值设置为建议值。 在单个任务中,包括默认值的当前对象将不可验证。 选项 
 | |
| 现有租户的名称。 | |
| 套接字级别的超时时间(以秒为单位)。 如果任务中未指定该值,则将使用环境变量  默认值为 30。 | |
| 传输数据平面类型。 选项 
 | |
| eBGP 多跳生存时间 | |
| 如果为  如果任务中未指定该值,则将使用环境变量  默认值为 true。 选项 
 | |
| 如果为  如果任务中未指定该值,则将使用环境变量  当连接为本地时,默认值为 true。 选项 
 | |
| 用于身份验证的用户名。 如果任务中未指定该值,则将使用环境变量  默认值为 admin。 | |
| 如果为  仅当在个人控制的站点上使用自签名证书时,才应将其设置为  如果任务中未指定该值,则将使用环境变量  默认值为 true。 选项 
 | |
| 来自此邻居的 BGP 路由的权重 | 
参见
另请参阅
- aci_l3out
- 关于 aci_l3out 模块的官方文档。 
- aci_l3out_logical_node_profile
- 关于 aci_l3out_logical_node_profile 模块的官方文档。 
- APIC 管理信息模型参考
- 有关内部 APIC 类 bgp:peerP 和 bgp:InfraPeerP 的更多信息 
- Cisco ACI 指南
- 有关如何使用 Ansible 管理 ACI 基础架构的详细信息。 
- 开发 Cisco ACI 模块
- 有关如何编写自己的 Cisco ACI 模块以进行贡献的详细指南。 
示例
- name: Add a new BGP peer on a physical interface
  cisco.aci.aci_l3out_bgp_peer:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: my_tenant
    l3out: my_l3out
    node_profile: my_node_profile
    interface_profile: my_interface_profile
    pod_id: 1
    node_id: 201
    path_ep: eth1/12
    peer_ip: 192.168.10.2
    remote_asn: 65456
    bgp_controls:
      - nh-self
      - send-com
      - send-ext-com
    peer_controls:
      - bfd
    route_control_profiles:
      - tenant: "ansible_tenant"
        profile: "anstest_import"
        direction: "import"
      - tenant: "ansible_tenant"
        profile: "anstest_export"
        direction: "export"
        l3out: "anstest_l3out"
        state: present
  delegate_to: localhost
- name: Add a new BGP peer on a vPC
  cisco.aci.aci_l3out_bgp_peer:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: my_tenant
    l3out: my_l3out
    node_profile: my_node_profile
    interface_profile: my_interface_profile
    pod_id: 1
    node_id: 201-202
    path_ep: my_vpc_ipg
    peer_ip: 192.168.20.2
    remote_asn: 65457
    ttl: 4
    weight: 50
    state: present
  delegate_to: localhost
- name: Create Infra BGP Peer with password
  aci_l3out_bgp_peer: &infra_bgp_peer
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: infra
    l3out: ansible_infra_l3out
    node_profile: ansible_infra_l3out_node_profile
    ttl: 2
    bgp_infra_peer: true
    bgp_password: ansible_test_password
    peer_ip: 192.168.50.2
    remote_asn: 65450
    local_as_number: 65460
    peer_type: sr_mpls
    bgp_controls:
      - send-domain-path
    transport_data_plane: sr_mpls
    bgp_peer_prefix_policy: ansible_peer_prefix_profile
    state: present
  delegate_to: localhost
- name: Shutdown a BGP peer
  cisco.aci.aci_l3out_bgp_peer:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: my_tenant
    l3out: my_l3out
    node_profile: my_node_profile
    interface_profile: my_interface_profile
    pod_id: 1
    node_id: 201
    path_ep: eth1/12
    peer_ip: 192.168.10.2
    admin_state: disabled
    state: present
  delegate_to: localhost
- name: Delete a BGP peer
  cisco.aci.aci_l3out_bgp_peer:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: my_tenant
    l3out: my_l3out
    node_profile: my_node_profile
    interface_profile: my_interface_profile
    pod_id: 1
    node_id: 201
    path_ep: eth1/12
    peer_ip: 192.168.10.2
    state: absent
  delegate_to: localhost
- name: Add BGP Peer to the Node Profile level
  cisco.aci.aci_l3out_bgp_peer:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: ansible_tenant
    l3out: ansible_l3out
    node_profile: ansible_node_profile
    peer_ip: 192.168.50.3
    route_control_profiles:
      - tenant: "ansible_tenant"
        profile: "anstest_import"
        direction: "import"
      - tenant: "ansible_tenant"
        profile: "anstest_export"
        direction: "export"
        l3out: "anstest_l3out"
    state: present
  delegate_to: localhost
- name: Query a BGP peer
  cisco.aci.aci_l3out_bgp_peer:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: my_tenant
    l3out: my_l3out
    node_profile: my_node_profile
    interface_profile: my_interface_profile
    pod_id: 1
    node_id: 201
    path_ep: eth1/12
    peer_ip: 192.168.10.2
    state: query
  delegate_to: localhost
  register: query_result
- name: Query all BGP peer
  cisco.aci.aci_l3out_bgp_peer:
    host: apic
    username: admin
    password: SomeSecretPassword
    state: query
  delegate_to: localhost
  register: query_all
- name: Query all BGP infra peer
  cisco.aci.aci_l3out_bgp_peer:
    host: apic
    username: admin
    password: SomeSecretPassword
    bgp_infra_peer: true
    state: query
  delegate_to: localhost
  register: query_all
返回值
常用返回值记录在 此处,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 模块完成后来自 APIC 的现有配置 返回: 成功 示例:  | |
| 从 APIC 返回的错误信息 返回: 失败 示例:  | |
| 用于请求的筛选字符串 返回: 失败或调试 示例:  | |
| 用于向 APIC 发出请求的 HTTP 方法 返回: 失败或调试 示例:  | |
| 模块启动前来自 APIC 的原始配置 返回: 信息 示例:  | |
| 由用户提供的参数组装的配置 返回: 信息 示例:  | |
| APIC REST API 返回的原始输出(xml 或 json) 返回: 解析错误 示例:  | |
| 来自 APIC 的 HTTP 响应 返回: 失败或调试 示例:  | |
| 实际/最小的配置被推送到 APIC 返回: 信息 示例:  | |
| 来自 APIC 的 HTTP 状态 返回: 失败或调试 示例:  | |
| 用于向 APIC 发出请求的 HTTP 网址 返回: 失败或调试 示例:  | 
