diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 20:03:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 20:03:01 +0000 |
commit | a453ac31f3428614cceb99027f8efbdb9258a40b (patch) | |
tree | f61f87408f32a8511cbd91799f9cececb53e0374 /collections-debian-merged/ansible_collections/dellemc/os9/playbooks | |
parent | Initial commit. (diff) | |
download | ansible-upstream.tar.xz ansible-upstream.zip |
Adding upstream version 2.10.7+merged+base+2.10.8+dfsg.upstream/2.10.7+merged+base+2.10.8+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collections-debian-merged/ansible_collections/dellemc/os9/playbooks')
11 files changed, 513 insertions, 0 deletions
diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/README.md b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/README.md new file mode 100644 index 00000000..410147db --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/README.md @@ -0,0 +1,35 @@ +# Provision CLOS fabric using the Ansible collection for Dell EMC OS9 + +This example describes how to use Ansible to build a CLOS fabric with a Dell EMC PowerSwitch platform running Dell EMC OS9 device. The sample topology is a two-tier CLOS fabric with two spines and four leaves connected as mesh. eBGP is running between the two tiers. All switches in spine have the same AS number, and each leaf switch has a unique AS number. All AS numbers used are private. + +For application load-balancing purposes, the same prefix is advertised from multiple leaf switches and uses _BGP multipath relax_ feature. + +![CLOS FABRIC Topology](https://ansible-dellos-docs.readthedocs.io/en/latest/_images/topo.png) + +## Create a simple Ansible playbook + +**1**. Create an inventory file called `inventory.yaml`, then specify the device IP address. + +**2**. Create a group variable file called `group_vars/all`, then define credentials and SNMP variables. + +**3**. Create a group variable file called `group_vars/spine.yaml`, then define credentials, hostname, and BGP neighbors of spine group. + +**4**. Create a host variable file called `host_vars/spine1.yaml`, then define the host, credentials, and transport. + +**5**. Create a host variable file called `host_vars/spine2.yaml`, then define the host, credentials, and transport. + +**6**. Create a host variable file called `host_vars/leaf1.yaml`, then define the host, credentials, and transport. + +**7**. Create a host variable file called `host_vars/leaf2.yaml`, then define the host, credentials, and transport. + +**8**. Create a host variable file called `host_vars/leaf3.yaml`, then define the host, credentials, and transport. + +**9**. Create a host variable file called `host_vars/leaf4.yaml`, then define the host, credentials, and transport. + +**10**. Create a playbook called `datacenter.yaml`. + +**11**. Run the playbook. + + ansible-playbook -i inventory.yaml datacenter.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/datacenter.yaml b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/datacenter.yaml new file mode 100644 index 00000000..f17ebd14 --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/datacenter.yaml @@ -0,0 +1,11 @@ +--- +- hosts: datacenter + gather_facts: no + connection: network_cli + collections: + - dellemc.os9 + roles: + - os9_interface + - os9_bgp + - os9_snmp + - os9_system diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/group_vars/all b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/group_vars/all new file mode 100644 index 00000000..c3e4398b --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/group_vars/all @@ -0,0 +1,10 @@ +ansible_ssh_user: xxxxx +ansible_ssh_pass: xxxxx +ansible_network_os: dellemc.os9.os9 +build_dir: ../tmp/tmp_os9 + +os9_snmp: + snmp_community: + - name: public + access_mode: ro + state: present diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/group_vars/spine.yaml b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/group_vars/spine.yaml new file mode 100644 index 00000000..17568725 --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/group_vars/spine.yaml @@ -0,0 +1,64 @@ +ansible_ssh_user: xxxxx +ansible_ssh_pass: xxxxx +ansible_network_os: dellemc.os9.os9 + +os9_system: + hostname: "{{ spine_hostname }}" + +os9_bgp: + asn: 64901 + router_id: "{{ bgp_router_id }}" + best_path: + as_path: ignore + as_path_state: present + med: + - attribute: confed + state: present + neighbor: + - type: ipv4 + remote_asn: "{{ bgp_neigh1_remote_asn }}" + ip: "{{ bgp_neigh1_ip }}" + admin: up + state: present + - type: ipv4 + remote_asn: "{{ bgp_neigh2_remote_asn }}" + ip: "{{ bgp_neigh2_ip }}" + admin: up + state: present + - type: ipv4 + remote_asn: "{{ bgp_neigh3_remote_asn }}" + ip: "{{ bgp_neigh3_ip }}" + admin: up + state: present + - type: ipv4 + remote_asn: "{{ bgp_neigh4_remote_asn }}" + ip: "{{ bgp_neigh4_ip }}" + admin: up + state: present + - type: ipv6 + remote_asn: "{{ bgp_neigh5_remote_asn }}" + ip: "{{ bgp_neigh5_ip }}" + admin: up + state: present + - type: ipv6 + remote_asn: "{{ bgp_neigh6_remote_asn }}" + ip: "{{ bgp_neigh6_ip }}" + admin: up + address_family: + - type: ipv4 + activate: false + state: present + - type: ipv6 + activate: true + state: present + state: present + - type: ipv6 + remote_asn: "{{ bgp_neigh7_remote_asn }}" + ip: "{{ bgp_neigh7_ip }}" + admin: up + state: present + - type: ipv6 + remote_asn: "{{ bgp_neigh8_remote_asn }}" + ip: "{{ bgp_neigh8_ip }}" + admin: up + state: present diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf1.yaml b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf1.yaml new file mode 100644 index 00000000..2244418e --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf1.yaml @@ -0,0 +1,61 @@ +ansible_ssh_user: xxxxx +ansible_ssh_pass: xxxxx +ansible_network_os: dellemc.os9.os9 +leaf_hostname: "leaf-1" +os9_system: + hostname: "{{ leaf_hostname }}" + hash_algo: + algo: + - name: ecmp + mode: xor1 + state: present +os9_interface: + TenGigabitEthernet 0/0: + desc: "Connected to Spine 1" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.1.1.2/24 + ipv6_and_mask: 2001:100:1:1::2/64 + state_ipv6: present + TenGigabitEthernet 0/1: + desc: "Connected to Spine 2" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.2.1.2/24 + ipv6_and_mask: 2001:100:2:1::2/64 + state_ipv6: present +os9_bgp: + asn: 64801 + router_id: 100.0.2.1 + best_path: + as_path: ignore + as_path_state: present + med: + - attribute: confed + state: present + neighbor: + - type: ipv4 + remote_asn: 64901 + ip: 100.1.1.1 + admin: up + state: present + - type: ipv4 + remote_asn: 64901 + ip: 100.2.1.1 + admin: up + state: present + - type: ipv6 + remote_asn: 64901 + ip: 2001:100:1:1::1 + admin: up + state: present + - type: ipv6 + remote_asn: 64901 + ip: 2001:100:2:1::1 + admin: up + state: present + state: present diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf2.yaml b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf2.yaml new file mode 100644 index 00000000..2e5cc580 --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf2.yaml @@ -0,0 +1,65 @@ +hostname: leaf2 +ansible_ssh_user: xxxxx +ansible_ssh_pass: xxxxx +ansible_network_os: dellemc.os9.os9 +leaf_hostname: "leaf-2" +os9_system: + hostname: "{{ leaf_hostname }}" + hash_algo: + algo: + - name: ecmp + mode: xor1 + state: present +os9_interface: + TenGigabitEthernet 0/0: + desc: "Connected to Spine 1" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.1.17.2/24 + ipv6_and_mask: 2001:100:1:11::2/64 + state_ipv6: present + TenGigabitEthernet 0/1: + desc: "Connected to Spine 2" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.2.17.2/24 + ipv6_and_mask: 2001:100:2:11::2/64 +os9_bgp: + asn: 64802 + router_id: 100.0.2.2 + best_path: + as_path: ignore + as_path_state: present + med: + - attribute: confed + state: present + neighbor: + - type: ipv4 + remote_asn: 64901 + ip: 100.1.18.1 + admin: up + state: present + - type: ipv4 + remote_asn: 64901 + ip: 100.1.17.1 + admin: up + state: present + - type: ipv4 + remote_asn: 64901 + ip: 100.2.17.1 + admin: up + state: present + - type: ipv6 + remote_asn: 64901 + ip: 2001:100:1:11::1 + admin: up + state: present + - type: ipv6 + remote_asn: 64901 + ip: 2001:100:2:11::1 + admin: up + state: present diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf3.yaml b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf3.yaml new file mode 100644 index 00000000..f14f44e0 --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf3.yaml @@ -0,0 +1,65 @@ +hostname: leaf3 +ansible_ssh_user: xxxxx +ansible_ssh_pass: xxxxx +ansible_network_os: dellemc.os9.os9 +leaf_hostname: "leaf-3" +os9_system: + hostname: "{{ leaf_hostname }}" + hash_algo: + algo: + - name: ecmp + mode: xor1 + state: present +os9_interface: + TenGigabitEthernet 0/0: + desc: "Connected to Spine 1" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.1.33.2/24 + ipv6_and_mask: 2001:100:1:21::2/64 + state_ipv6: present + TenGigabitEthernet 0/1: + desc: "Connected to Spine 2" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.2.33.2/24 + ipv6_and_mask: 2001:100:2:21::2/64 +os9_bgp: + asn: 64803 + router_id: 100.0.2.3 + best_path: + as_path: ignore + as_path_state: present + med: + - attribute: confed + state: present + neighbor: + - type: ipv4 + remote_asn: 64901 + ip: 100.1.33.1 + admin: up + state: present + - type: ipv4 + remote_asn: 64901 + ip: 100.2.33.1 + admin: up + state: present + - type: ipv6 + remote_asn: 64901 + ip: 2001:100:1:21::1 + admin: up + state: present + - type: ipv6 + remote_asn: 64901 + ip: 2001:100:1:22::1 + admin: up + state: present + - type: ipv6 + remote_asn: 64901 + ip: 2001:100:2:21::1 + admin: up + state: present diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf4.yaml b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf4.yaml new file mode 100644 index 00000000..9fc8ca87 --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/leaf4.yaml @@ -0,0 +1,61 @@ +hostname: leaf4 +ansible_ssh_user: xxxxx +ansible_ssh_pass: xxxxx +ansible_network_os: dellemc.os9.os9 +leaf_hostname: "leaf-4" +os9_system: + hostname: "{{ leaf_hostname }}" + hash_algo: + algo: + - name: ecmp + mode: xor1 + state: present +os9_interface: + TenGigabitEthernet 0/0: + desc: "Connected to Spine 1" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.1.49.2/24 + ipv6_and_mask: 2001:100:1:31::2/64 + state_ipv6: present + TenGigabitEthernet 0/1: + desc: "Connected to Spine 2" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.2.49.2/24 + ipv6_and_mask: 2001:100:2:31::2/64 + state_ipv6: present +os9_bgp: + asn: 64804 + router_id: 100.0.2.4 + best_path: + as_path: ignore + as_path_state: present + med: + - attribute: confed + state: present + neighbor: + - type: ipv4 + remote_asn: 64901 + ip: 100.1.49.1 + admin: up + state: present + - type: ipv4 + remote_asn: 64901 + ip: 100.2.49.1 + admin: up + state: present + - type: ipv6 + remote_asn: 64901 + ip: 2001:100:1:31::1 + admin: up + state: present + - type: ipv6 + remote_asn: 64901 + ip: 2001:100:2:31::1 + admin: up + state: present diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/spine1.yaml b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/spine1.yaml new file mode 100644 index 00000000..9967d338 --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/spine1.yaml @@ -0,0 +1,61 @@ +hostname: spine1 +ansible_ssh_user: xxxxx +ansible_ssh_pass: xxxxx +ansible_network_os: dellemc.os9.os9 +spine_hostname: "spine-1" + +os9_interface: + TenGigabitEthernet 0/2: + desc: "Connected to leaf 1" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.1.1.1/24 + ipv6_and_mask: 2001:100:1:1::1/64 + state_ipv6: present + TenGigabitEthernet 0/3: + desc: "Connected to leaf 2" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.1.33.1/24 + ipv6_and_mask: 2001:100:1:21::1/64 + state_ipv6: present + TenGigabitEthernet 0/4: + desc: "Connected to leaf 3" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.1.17.1/24 + ipv6_and_mask: 2001:100:1:11::1/64 + state_ipv6: present + TenGigabitEthernet 0/5: + desc: "Connected to leaf 4" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.1.49.1/24 + ipv6_and_mask: 2001:100:1:31::1/64 + state_ipv6: present + +bgp_router_id: "100.0.1.1" +bgp_neigh1_remote_asn: 64801 +bgp_neigh1_ip: "100.1.1.2" +bgp_neigh2_remote_asn: 64803 +bgp_neigh2_ip: "100.1.33.2" +bgp_neigh3_remote_asn: 64802 +bgp_neigh3_ip: "100.1.17.2" +bgp_neigh4_remote_asn: 64804 +bgp_neigh4_ip: "100.1.49.2" +bgp_neigh5_remote_asn: 64801 +bgp_neigh5_ip: "2001:100:1:1::2" +bgp_neigh6_remote_asn: 64802 +bgp_neigh6_ip: "2001:100:1:11::2" +bgp_neigh7_remote_asn: 64803 +bgp_neigh7_ip: "2001:100:1:21::2" +bgp_neigh8_remote_asn: 64804 +bgp_neigh8_ip: "2001:100:1:31::2" diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/spine2.yaml b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/spine2.yaml new file mode 100644 index 00000000..218d6478 --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/host_vars/spine2.yaml @@ -0,0 +1,60 @@ +hostname: spine2 +ansible_ssh_user: xxxxx +ansible_ssh_pass: xxxxx +ansible_network_os: dellemc.os9.os9 +spine_hostname: "spine-2" +os9_interface: + TenGigabitEthernet 0/6: + desc: "Connected to leaf 1" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.2.1.1/24 + ipv6_and_mask: 2001:100:2:1::1/64 + state_ipv6: present + TenGigabitEthernet 0/7: + desc: "Connected to leaf 2" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.2.17.1/24 + ipv6_and_mask: 2001:100:2:11::1/64 + state_ipv6: present + TenGigabitEthernet 0/8: + desc: "Connected to leaf 3" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.2.33.1/24 + ipv6_and_mask: 2001:100:2:21::1/64 + state_ipv6: present + TenGigabitEthernet 0/9: + desc: "Connected to leaf 4" + mtu: 9216 + portmode: + admin: up + switchport: False + ip_and_mask: 100.2.49.1/24 + ipv6_and_mask: 2001:100:2:31::1/64 + state_ipv6: present + +bgp_router_id: "100.0.1.2" +bgp_neigh1_remote_asn: 64801 +bgp_neigh1_ip: "100.2.1.2" +bgp_neigh2_remote_asn: 64802 +bgp_neigh2_ip: "100.2.33.2" +bgp_neigh3_remote_asn: 64803 +bgp_neigh3_ip: "100.2.17.2" +bgp_neigh4_remote_asn: 64804 +bgp_neigh4_ip: "100.2.49.2" +bgp_neigh5_remote_asn: 64801 +bgp_neigh5_ip: "2001:100:2:1::2" +bgp_neigh6_remote_asn: 64802 +bgp_neigh6_ip: "2001:100:2:11::2" +bgp_neigh7_remote_asn: 64803 +bgp_neigh7_ip: "2001:100:2:21::2" +bgp_neigh8_remote_asn: 64804 +bgp_neigh8_ip: "2001:100:2:31::2" diff --git a/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/inventory.yaml b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/inventory.yaml new file mode 100644 index 00000000..5fd33c94 --- /dev/null +++ b/collections-debian-merged/ansible_collections/dellemc/os9/playbooks/clos_fabric_ebgp/inventory.yaml @@ -0,0 +1,20 @@ +spine1 ansible_host=100.94.210.44 +spine2 ansible_host=10.11.182.26 +leaf1 ansible_host=10.11.182.27 +leaf2 ansible_host=10.11.182.28 +leaf3 ansible_host=10.11.182.29 +leaf4 ansible_host=10.11.182.30 + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf |