dellemc.enterprise_sonic.sonic_bgp_as_paths 模块 – 管理 BGP 自治系统路径(或 AS 路径列表)及其参数

注意

此模块是 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_bgp_as_paths

dellemc.enterprise_sonic 1.0.0 中的新功能

概要

  • 此模块为运行戴尔科技 Enterprise SONiC Distribution 的设备提供 BGP bgp_as_paths 的配置管理。

注意

此模块具有相应的 action 插件

参数

参数

注释

config

列表 / 元素=字典

“bgp_as_paths”配置的列表。

members

列表 / 元素=字符串

此 BGP AS 路径的成员;可以提供正则表达式字符串。

name

字符串 / 必需

AS 路径列表的名称。

permit

布尔值

允许或拒绝此 AS 路径。

添加新的 AS 路径列表时的默认值为 False

选项

  • false

  • true

state

字符串

模块完成后配置的状态。

选项

  • "merged" ← (默认)

  • "deleted"

  • "replaced"

  • "overridden"

说明

注意

  • 针对戴尔科技的 Enterprise SONiC Distribution 进行了测试。

  • 支持 check_mode

示例

# Using deleted

# Before state:
# -------------
#
# show bgp as-path-access-list
# AS path list test:
#   action: permit
#   members: 808.*,909.*

  - name: Delete BGP as path list
    dellemc.enterprise_sonic.sonic_bgp_as_paths:
      config:
        - name: test
          members:
            - 909.*
          permit: true
      state: deleted

# After state:
# ------------
#
# show bgp as-path-access-list
# AS path list test:
#   action: permit
#   members: 808.*


# Using deleted

# Before state:
# -------------
#
# show bgp as-path-access-list
# AS path list test:
#   action: permit
#   members: 808.*,909.*
# AS path list test1:
#   action: deny
#   members: 608.*,709.*

  - name: Deletes BGP as-path list
    dellemc.enterprise_sonic.sonic_bgp_as_paths:
      config:
        - name: test
          members:
      state: deleted

# After state:
# ------------
#
# show bgp as-path-access-list
# AS path list test1:
#   action: deny
#   members: 608.*,709.*


# Using deleted

# Before state:
# -------------
#
# show bgp as-path-access-list
# AS path list test:
#   action: permit
#   members: 808.*,909.*

  - name: Deletes BGP as-path list
    dellemc.enterprise_sonic.sonic_bgp_as_paths:
      config:
      state: deleted

# After state:
# ------------
#
# show bgp as-path-access-list
# (No bgp as-path-access-list configuration present)


# Using merged

# Before state:
# -------------
#
# show bgp as-path-access-list
# (No bgp as-path-access-list configuration present)

  - name: Create a BGP as-path list
    dellemc.enterprise_sonic.sonic_bgp_as_paths:
      config:
        - name: test
          members:
            - 909.*
          permit: true
      state: merged

# After state:
# ------------
#
# show bgp as-path-access-list
# AS path list test:
#   action: permit
#   members: 909.*


# Using replaced

# Before state:
# -------------
#
# show bgp as-path-access-list
# AS path list test:
#    action: permit
#    members: 800.*,808.*
# AS path list test1:
#    action: deny
#    members: 500.*

  - name: Replace device configuration of specified BGP as-path lists with provided configuration
    dellemc.enterprise_sonic.sonic_bgp_as_paths:
      config:
        - name: test
          members:
            - 900.*
            - 901.*
          permit: true
        - name: test1
        - name: test2
          members:
            - 100.*
          permit: true
      state: replaced

# After state:
# ------------
#
# show bgp as-path-access-list
# AS path list test:
#    action: permit
#    members: 900.*,901.*
# AS path list test2:
#    action: permit
#    members: 100.*


# Using overridden

# Before state:
# -------------
#
# show bgp as-path-access-list
# AS path list test:
#    action: permit
#    members: 800.*,808.*
# AS path list test1:
#    action: deny
#    members: 500.*

  - name: Override device configuration of all BGP as-path lists with provided configuration
    dellemc.enterprise_sonic.sonic_bgp_as_paths:
      config:
        - name: test
          members:
            - 900.*
            - 901.*
          permit: true
      state: overridden

# After state:
# ------------
#
# show bgp as-path-access-list
# AS path list test:
#    action: permit
#    members: 900.*,901.*

返回值

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

描述

after

列表 / 元素=字符串

生成的配置模块调用。

返回: 当发生更改时

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

before

列表 / 元素=字符串

模块调用之前的配置。

返回: 始终

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

commands

列表 / 元素=字符串

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

返回: 始终

示例: ["command 1", "command 2", "command 3"]

作者

  • Kumaraguru Narayanan (@nkumaraguru)