summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/enterprise_sonic/playbooks
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-18 05:52:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-18 05:52:22 +0000
commit38b7c80217c4e72b1d8988eb1e60bb6e77334114 (patch)
tree356e9fd3762877d07cde52d21e77070aeff7e789 /ansible_collections/dellemc/enterprise_sonic/playbooks
parentAdding upstream version 7.7.0+dfsg. (diff)
downloadansible-38b7c80217c4e72b1d8988eb1e60bb6e77334114.tar.xz
ansible-38b7c80217c4e72b1d8988eb1e60bb6e77334114.zip
Adding upstream version 9.4.0+dfsg.upstream/9.4.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/dellemc/enterprise_sonic/playbooks')
-rw-r--r--ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_config.yaml27
-rw-r--r--ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_off.yaml6
-rw-r--r--ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_on.yaml6
3 files changed, 39 insertions, 0 deletions
diff --git a/ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_config.yaml b/ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_config.yaml
new file mode 100644
index 000000000..24794ad76
--- /dev/null
+++ b/ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_config.yaml
@@ -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
diff --git a/ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_off.yaml b/ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_off.yaml
new file mode 100644
index 000000000..c1c72f9ee
--- /dev/null
+++ b/ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_off.yaml
@@ -0,0 +1,6 @@
+- name: Delete mgmt VRF configuration
+ sonic_vrfs:
+ config:
+ - name: mgmt
+ state: deleted
+ ignore_errors: yes
diff --git a/ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_on.yaml b/ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_on.yaml
new file mode 100644
index 000000000..109b14fc0
--- /dev/null
+++ b/ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/mgmt_vrf_on.yaml
@@ -0,0 +1,6 @@
+- name: Create mgmt VRF configuration
+ sonic_vrfs:
+ config:
+ - name: mgmt
+ state: merged
+ ignore_errors: yes