Skip to content

Commit

Permalink
Provided workaround for SONiC mgmt vrf bug (#146)
Browse files Browse the repository at this point in the history
* Provided workaround for SONiC mgmt vrf bug

* Addressed review comments

Co-authored-by: Shade Talabi <[email protected]>
  • Loading branch information
stalabi1 and Shade Talabi authored Dec 16, 2022
1 parent d6318b3 commit 534f2ed
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
27 changes: 27 additions & 0 deletions playbooks/common_examples/mgmt_vrf_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# Execution of a task that adds or deletes the configuration of the
# management VRF ("mgmt") causes a disruption of the
# management interface connection on which playbook configuration
# commands are executing. As a result, playbook execution is aborted
# unless the management VRF configuration task is constructed to
# ignore errors.
#
# This example demonstrates how to combine tasks that configure other
# resource modules ("sonic_vrfs", in this case) with tasks that add or remove
# "management VRF" configuration.

- name: Example playbook of configuring with mgmt_vrf_on and mgmt_vrf_off tasks.
hosts: datacenter
gather_facts: False
connection: httpapi
collections:
- dellemc.enterprise_sonic
tasks:
- include_tasks: mgmt_vrf_on.yaml
- name: Add VLANs
sonic_vlans:
config:
- vlan_id: 11
- vlan_id: 12
state: merged
- include_tasks: mgmt_vrf_off.yaml
6 changes: 6 additions & 0 deletions playbooks/common_examples/mgmt_vrf_off.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Delete mgmt VRF configuration
sonic_vrfs:
config:
- name: mgmt
state: deleted
ignore_errors: yes
6 changes: 6 additions & 0 deletions playbooks/common_examples/mgmt_vrf_on.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Create mgmt VRF configuration
sonic_vrfs:
config:
- name: mgmt
state: merged
ignore_errors: yes

0 comments on commit 534f2ed

Please sign in to comment.