dellemc.enterprise_sonic.sonic_vrfs 模块 – 管理 VRF 并将 VRF 与接口(例如 Eth、LAG、VLAN 和环回接口)关联
注意
此模块是 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_vrfs。
dellemc.enterprise_sonic 1.0.0 中的新增功能
概要
- 管理戴尔科技公司提供的企业 SONiC 发行版中的 VRF 和 VRF 接口属性。 
注意
此模块具有相应的 action 插件。
参数
| 参数 | 注释 | 
|---|---|
| VRF 配置列表。 | |
| 包含一个字典映射,其中包含链接到 VRF 接口的接口列表。 | |
| 链接到特定 VRF 接口的接口名称列表。 | |
| 物理接口的名称。 | |
| VRF 接口的名称。 | |
| 模块完成后的配置状态。 选项 
 | 
备注
注意
- 针对戴尔科技公司提供的企业 SONiC 发行版进行了测试。 
- 支持 - check_mode。
示例
# Using deleted
#
# Before state:
# -------------
#
#show ip vrf
#VRF-NAME            INTERFACES
#----------------------------------------------------------------
#Vrfcheck1
#Vrfcheck2
#Vrfcheck3           Eth1/3
#                    Eth1/14
#                    Eth1/16
#                    Eth1/17
#Vrfcheck4           Eth1/5
#                    Eth1/6
#
- name: Configuring vrf deleted state
  dellemc.enterprise_sonic.sonic_vrfs:
    config:
     - name: Vrfcheck4
       members:
         interfaces:
           - name: Eth1/6
     - name: Vrfcheck3
       members:
         interfaces:
           - name: Eth1/3
           - name: Eth1/14
    state: deleted
#
# After state:
# ------------
#
#show ip vrf
#VRF-NAME            INTERFACES
#----------------------------------------------------------------
#Vrfcheck1
#Vrfcheck2
#Vrfcheck3           Eth1/16
#                    Eth1/17
#Vrfcheck4           Eth1/5
#
#
# Using merged
#
# Before state:
# -------------
#
#show ip vrf
#VRF-NAME            INTERFACES
#----------------------------------------------------------------
#Vrfcheck1
#Vrfcheck2
#Vrfcheck3           Eth1/16
#                    Eth1/17
#Vrfcheck4
#
- name: Configuring vrf merged state
  dellemc.enterprise_sonic.sonic_vrfs:
    config:
     - name: Vrfcheck4
       members:
         interfaces:
           - name: Eth1/5
           - name: Eth1/6
     - name: Vrfcheck3
       members:
         interfaces:
           - name: Eth1/3
           - name: Eth1/14
    state: merged
#
# After state:
# ------------
#
#show ip vrf
#VRF-NAME            INTERFACES
#----------------------------------------------------------------
#Vrfcheck1
#Vrfcheck2
#Vrfcheck3           Eth1/3
#                    Eth1/14
#                    Eth1/16
#                    Eth1/17
#Vrfcheck4           Eth1/5
#                    Eth1/6
#
# Using overridden
#
# Before state:
# -------------
#
#show ip vrf
#VRF-NAME            INTERFACES
#----------------------------------------------------------------
#Vrfcheck1
#Vrfcheck2
#Vrfcheck3           Eth1/7
#                    Eth1/8
#
- name: Overridden VRF configuration
  dellemc.enterprise_sonic.sonic_vrfs:
  sonic_vrfs:
    config:
      - name: Vrfcheck1
        members:
          interfaces:
            - name: Eth1/3
            - name: Eth1/14
      - name: Vrfcheck3
        members:
          interfaces:
            - name: Eth1/5
            - name: Eth1/6
    state: overridden
#
# After state:
# ------------
#
#show ip vrf
#VRF-NAME            INTERFACES
#----------------------------------------------------------------
#Vrfcheck1           Eth1/3
#                    Eth1/14
#Vrfcheck2
#Vrfcheck3           Eth1/5
#                    Eth1/6
#
# Using replaced
#
# Before state:
# -------------
#
#show ip vrf
#VRF-NAME            INTERFACES
#----------------------------------------------------------------
#Vrfcheck1           Eth1/3
#Vrfcheck2
#Vrfcheck3           Eth1/5
#                    Eth1/6
#
- name: Replace VRF configuration
  dellemc.enterprise_sonic.sonic_vrfs:
  sonic_vrfs:
    config:
      - name: Vrfcheck1
        members:
          interfaces:
            - name: Eth1/3
            - name: Eth1/14
      - name: Vrfcheck3
        members:
          interfaces:
            - name: Eth1/5
            - name: Eth1/6
    state: replaced
#
# After state:
# ------------
#
#show ip vrf
#VRF-NAME            INTERFACES
#----------------------------------------------------------------
#Vrfcheck1           Eth1/3
#                    Eth1/14
#Vrfcheck2
#Vrfcheck3           Eth1/5
#                    Eth1/6
#
返回值
公共返回值已在 此处 记录,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 模块调用后的结果配置。 返回:发生更改时 示例:  | |
| 模块调用之前的配置。 返回:始终返回 示例:  | |
| 推送到远程设备的命令集。 返回:始终返回 示例:  | 
