[CookBook] Ansible_4_Dell EMC Networking
This document is the purpose of education for Ansible on the DELL EMC OS10
Copyright <2019> Hoon_Jo@dell.com < Github : https://github.com/sysnet4admin >
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to
do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0. Pre-Conditions
Predifined Group_Vars
ansible_user: ansible
ansible_ssh_pass: Ansible00
ansible_become_method: enable
ansible_become: yes
ansible_become_pass: admin
ansible_network_os: dellos10
ansible_connection: network_cli
Config Chagne
[vagrant@ansible-server ~]$ ansible-config dump --only-changed
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
PERSISTENT_COMMAND_TIMEOUT(/etc/ansible/ansible.cfg) = 60
Inventory
[dellos10]
172.16.1.[1:4]
Topology
1. ad-hoc
1-1. Source Code
ansible dellos10 -m ping
ansible dellos10 -m dellos10_command -a "commands='show version'"
[Code 1-1] 1.ad-hoc
1.2. Run the Code
Note: ans = ansible (alias)
[vagrant@ansible-server ~]$ ans dellos10 -m ping
172.16.1.1 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
172.16.1.3 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
172.16.1.2 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
172.16.1.4 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
[vagrant@ansible-server ~]$ ans dellos10 -m dellos10_command -a 
"commands='show version'"
172.16.1.1 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"stdout": [
"Dell EMC Networking OS10-EnterprisenCopyright (c) 1999-2019 by Dell
Inc. All Rights Reserved.nOS Version: 10.4.3.1nBuild Version:
10.4.3.1.154nBuild Time: 2019-03-20T18:16:25-0700nSystem Type: S4048-
ONnArchitecture: x86_64nUp Time: 02:11:07"
],
"stdout_lines": [
[
"Dell EMC Networking OS10-Enterprise",
"Copyright (c) 1999-2019 by Dell Inc. All Rights Reserved.",
"OS Version: 10.4.3.1",
"Build Version: 10.4.3.1.154",
"Build Time: 2019-03-20T18:16:25-0700",
"System Type: S4048-ON",
"Architecture: x86_64",
"Up Time: 02:11:07"
]
]
}
172.16.1.3 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"stdout": [
"Dell EMC Networking OS10 EnterprisenCopyright (c) 1999-2019 by Dell
Inc. All Rights Reserved.nOS Version: 10.5.0.0nBuild Version:
10.5.0.0.326nBuild Time: 2019-08-07T00:12:30+0000nSystem Type: S4148U-
ONnArchitecture: x86_64nUp Time: 02:10:59"
],
"stdout_lines": [
[
"Dell EMC Networking OS10 Enterprise",
"Copyright (c) 1999-2019 by Dell Inc. All Rights Reserved.",
"OS Version: 10.5.0.0",
"Build Version: 10.5.0.0.326",
"Build Time: 2019-08-07T00:12:30+0000",
"System Type: S4148U-ON",
"Architecture: x86_64",
"Up Time: 02:10:59"
]
]
}
172.16.1.2 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"stdout": [
"Dell EMC Networking OS10-EnterprisenCopyright (c) 1999-2019 by Dell
Inc. All Rights Reserved.nOS Version: 10.4.3.1nBuild Version:
10.4.3.1.154nBuild Time: 2019-03-20T18:16:25-0700nSystem Type: S4048-
ONnArchitecture: x86_64nUp Time: 02:11:08"
],
"stdout_lines": [
[
"Dell EMC Networking OS10-Enterprise",
"Copyright (c) 1999-2019 by Dell Inc. All Rights Reserved.",
"OS Version: 10.4.3.1",
"Build Version: 10.4.3.1.154",
"Build Time: 2019-03-20T18:16:25-0700",
"System Type: S4048-ON",
"Architecture: x86_64",
"Up Time: 02:11:08"
]
]
}
172.16.1.4 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"stdout": [
"Dell EMC Networking OS10 EnterprisenCopyright (c) 1999-2019 by Dell
Inc. All Rights Reserved.nOS Version: 10.5.0.0nBuild Version:
10.5.0.0.326nBuild Time: 2019-08-07T00:12:30+0000nSystem Type: S4112T-
ONnArchitecture: x86_64nUp Time: 02:11:03"
],
"stdout_lines": [
[
"Dell EMC Networking OS10 Enterprise",
"Copyright (c) 1999-2019 by Dell Inc. All Rights Reserved.",
"OS Version: 10.5.0.0",
"Build Version: 10.5.0.0.326",
"Build Time: 2019-08-07T00:12:30+0000",
"System Type: S4112T-ON",
"Architecture: x86_64",
"Up Time: 02:11:03"
]
]
}
2. Create new VLAN
2.1. Source Code
---
- name: Create vlan for LEFT spine
hosts: dellos10[0]
gather_facts: no
tasks:
- name: input config for int vlan 11
dellos10_config:
lines:
- interface vlan 11
- ip address 11.1.1.1/24
- no shutdown
- name: input config for po1
dellos10_config:
lines:
- interface port-channel 1
- switchport trunk allowed vlan 11
- name: Create vlan for RIGHT spine
hosts: dellos10[1]
gather_facts: no
tasks:
- name: input config for int vlan 11
dellos10_config:
lines:
- interface vlan 11
- ip address 11.1.1.2/24
- no shutdown
- name: input config for po1
dellos10_config:
lines:
- interface port-channel 1
- switchport trunk allowed vlan 11
- name: Create vlan for TOR
hosts: dellos10[2]
gather_facts: no
tasks:
- name: input config for int vlan 11
dellos10_config:
lines:
- interface vlan 11
- no shutdown
- name: input config for uplink
dellos10_config:
lines:
- interface port-channel 1
- switchport trunk allowed vlan 11
- name: input config for downlink
dellos10_config:
lines:
- interface ethernet 1/1/27
- switchport trunk allowed vlan 11
- name: Create vlan for Access
hosts: dellos10[3]
gather_facts: no
tasks:
- name: input config for int vlan 11
dellos10_config:
lines:
- interface vlan 11
- ip address 11.1.1.4/24
- no shutdown
- name: input config for uplink
dellos10_config:
lines:
- 'interface ethernet 1/1/13:1'
- switchport trunk allowed vlan 11
[Code 2-1] 2.cr_vlan.yml
2.2. Run the Code
Note: anp = ansible-playbook (alias)
[vagrant@ansible-server ~]$ anp cr_vlan.yml
PLAY [Create vlan for LEFT spine] *********************************************
TASK [input config for int vlan 11] *******************************************
changed: [172.16.1.1]
TASK [input config for po1] ***************************************************
changed: [172.16.1.1]
PLAY [Create vlan for RIGHT spine] ********************************************
TASK [input config for int vlan 11] *******************************************
changed: [172.16.1.2]
TASK [input config for po1] ***************************************************
changed: [172.16.1.2]
PLAY [Create vlan for TOR] ****************************************************
TASK [input config for int vlan 11] *******************************************
changed: [172.16.1.3]
TASK [input config for uplink] ************************************************
changed: [172.16.1.3]
TASK [input config for downlink] **********************************************
changed: [172.16.1.3]
PLAY [Create vlan for Access] *************************************************
TASK [input config for int vlan 11] *******************************************
changed: [172.16.1.4]
TASK [input config for uplink] ************************************************
changed: [172.16.1.4]
PLAY RECAP ********************************************************************
172.16.1.1 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
172.16.1.2 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
172.16.1.3 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
172.16.1.4 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
2.3. Check Status
[ Access: ping to left Spine ]
S4112T# ping 11.1.1.1
PING 11.1.1.1 (11.1.1.1) 56(84) bytes of data.
64 bytes from 11.1.1.1: icmp_seq=1 ttl=64 time=1.02 ms
64 bytes from 11.1.1.1: icmp_seq=2 ttl=64 time=0.984 ms
64 bytes from 11.1.1.1: icmp_seq=3 ttl=64 time=0.983 ms
^C
--- 11.1.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.983/0.997/1.025/0.032 ms
[ Access: ping to right Spine ]
S4112T# ping 11.1.1.2
PING 11.1.1.2 (11.1.1.2) 56(84) bytes of data.
64 bytes from 11.1.1.2: icmp_seq=1 ttl=64 time=0.891 ms
64 bytes from 11.1.1.2: icmp_seq=2 ttl=64 time=0.835 ms
64 bytes from 11.1.1.2: icmp_seq=3 ttl=64 time=0.957 ms
^C
--- 11.1.1.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2009ms
rtt min/avg/max/mdev = 0.835/0.894/0.957/0.055 ms
3. Config BFD
3.1. Source Code
---
- name: Config BFD for LEFT spine
hosts: dellos10[0]
gather_facts: no
tasks:
- name: input config for loopback0
dellos10_config:
lines:
- interface loopback 0
- ip address 1.1.1.1/32
- no shutdown
- name: input config for routing
dellos10_config:
lines:
- ip route 4.4.4.4/32 11.1.1.4
- name: Config BFD for RIGHT spine
hosts: dellos10[1]
gather_facts: no
tasks:
- name: input config for loopback0
dellos10_config:
lines:
- interface loopback 0
- ip address 2.2.2.2/32
- no shutdown
- name: input config for routing
dellos10_config:
lines:
- ip route 4.4.4.4/32 11.1.1.4
- name: Config BFD for Access
hosts: dellos10[3]
gather_facts: no
tasks:
- name: input config for loopback0
dellos10_config:
lines:
- interface loopback 0
- ip address 4.4.4.4/32
- no shutdown
- name: input config for routing
dellos10_config:
lines:
- ip route 1.1.1.1/32 11.1.1.1
- ip route 2.2.2.2/32 11.1.1.2
[Code 3-1] 3.cfg_BFD.yml
3.2. Run the Code
Note: anp = ansible-playbook (alias)
[vagrant@ansible-server ~]$ anp 3.cfg_BFD.yml
PLAY [Config BFD for LEFT spine] **********************************************
TASK [input config for loopback0] *********************************************
changed: [172.16.1.1]
TASK [input config for routing] ***********************************************
changed: [172.16.1.1]
PLAY [Config BFD for RIGHT spine] *********************************************
TASK [input config for loopback0] *********************************************
changed: [172.16.1.2]
TASK [input config for routing] ***********************************************
changed: [172.16.1.2]
PLAY [Config BFD for Access] **************************************************
TASK [input config for loopback0] *********************************************
changed: [172.16.1.4]
TASK [input config for routing] ***********************************************
changed: [172.16.1.4]
PLAY RECAP ********************************************************************
172.16.1.1 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
172.16.1.2 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
172.16.1.4 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
3.3. Check Status
[ Left Spine : show bfd neighbors ]
S4048-1# show bfd neighbors
* - Active session role
-----------------------------------------------------------------------------------------
LocalAddr RemoteAddr Interface State RxInt TxInt Mult VRF Clients
-----------------------------------------------------------------------------------------
* 10.1.1.1 10.1.1.4 vlan10 up 200 200 3 default rtmv4
* 11.1.1.1 11.1.1.4 vlan11 up 200 200 3 default rtmv4
[ Right Spine : show bfd neighbors ]
S4048-2# show bfd neighbors
* - Active session role
-----------------------------------------------------------------------------------------
LocalAddr RemoteAddr Interface State RxInt TxInt Mult VRF Clients
-----------------------------------------------------------------------------------------
* 10.1.1.2 10.1.1.4 vlan10 up 200 200 3 default rtmv4
* 11.1.1.2 11.1.1.4 vlan11 up 200 200 3 default rtmv4
[ Access: show bfd neighbors ]
S4112T# show bfd neighbors
* - Active session role
-----------------------------------------------------------------------------------------
LocalAddr RemoteAddr Interface State RxInt TxInt Mult VRF Clients
-----------------------------------------------------------------------------------------
* 10.1.1.4 10.1.1.1 vlan10 up 200 200 3 default rtmv4
* 10.1.1.4 10.1.1.2 vlan10 up 200 200 3 default rtmv4
* 11.1.1.4 11.1.1.1 vlan11 up 200 200 3 default rtmv4
* 11.1.1.4 11.1.1.2 vlan11 up 200 200 3 default rtmv4

[Cook book] ansible 4_dell emc networking

  • 1.
    [CookBook] Ansible_4_Dell EMCNetworking This document is the purpose of education for Ansible on the DELL EMC OS10 Copyright <2019> Hoon_Jo@dell.com < Github : https://github.com/sysnet4admin > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • 2.
    0. Pre-Conditions Predifined Group_Vars ansible_user:ansible ansible_ssh_pass: Ansible00 ansible_become_method: enable ansible_become: yes ansible_become_pass: admin ansible_network_os: dellos10 ansible_connection: network_cli Config Chagne [vagrant@ansible-server ~]$ ansible-config dump --only-changed HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False PERSISTENT_COMMAND_TIMEOUT(/etc/ansible/ansible.cfg) = 60 Inventory [dellos10] 172.16.1.[1:4] Topology
  • 3.
    1. ad-hoc 1-1. SourceCode ansible dellos10 -m ping ansible dellos10 -m dellos10_command -a "commands='show version'" [Code 1-1] 1.ad-hoc 1.2. Run the Code Note: ans = ansible (alias) [vagrant@ansible-server ~]$ ans dellos10 -m ping 172.16.1.1 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong" } 172.16.1.3 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong" } 172.16.1.2 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong" } 172.16.1.4 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong" } [vagrant@ansible-server ~]$ ans dellos10 -m dellos10_command -a "commands='show version'" 172.16.1.1 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "stdout": [ "Dell EMC Networking OS10-EnterprisenCopyright (c) 1999-2019 by Dell Inc. All Rights Reserved.nOS Version: 10.4.3.1nBuild Version: 10.4.3.1.154nBuild Time: 2019-03-20T18:16:25-0700nSystem Type: S4048- ONnArchitecture: x86_64nUp Time: 02:11:07"
  • 4.
    ], "stdout_lines": [ [ "Dell EMCNetworking OS10-Enterprise", "Copyright (c) 1999-2019 by Dell Inc. All Rights Reserved.", "OS Version: 10.4.3.1", "Build Version: 10.4.3.1.154", "Build Time: 2019-03-20T18:16:25-0700", "System Type: S4048-ON", "Architecture: x86_64", "Up Time: 02:11:07" ] ] } 172.16.1.3 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "stdout": [ "Dell EMC Networking OS10 EnterprisenCopyright (c) 1999-2019 by Dell Inc. All Rights Reserved.nOS Version: 10.5.0.0nBuild Version: 10.5.0.0.326nBuild Time: 2019-08-07T00:12:30+0000nSystem Type: S4148U- ONnArchitecture: x86_64nUp Time: 02:10:59" ], "stdout_lines": [ [ "Dell EMC Networking OS10 Enterprise", "Copyright (c) 1999-2019 by Dell Inc. All Rights Reserved.", "OS Version: 10.5.0.0", "Build Version: 10.5.0.0.326", "Build Time: 2019-08-07T00:12:30+0000", "System Type: S4148U-ON", "Architecture: x86_64", "Up Time: 02:10:59" ] ] } 172.16.1.2 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "stdout": [ "Dell EMC Networking OS10-EnterprisenCopyright (c) 1999-2019 by Dell Inc. All Rights Reserved.nOS Version: 10.4.3.1nBuild Version: 10.4.3.1.154nBuild Time: 2019-03-20T18:16:25-0700nSystem Type: S4048- ONnArchitecture: x86_64nUp Time: 02:11:08" ], "stdout_lines": [ [ "Dell EMC Networking OS10-Enterprise", "Copyright (c) 1999-2019 by Dell Inc. All Rights Reserved.", "OS Version: 10.4.3.1", "Build Version: 10.4.3.1.154", "Build Time: 2019-03-20T18:16:25-0700", "System Type: S4048-ON", "Architecture: x86_64", "Up Time: 02:11:08"
  • 5.
    ] ] } 172.16.1.4 | SUCCESS=> { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "stdout": [ "Dell EMC Networking OS10 EnterprisenCopyright (c) 1999-2019 by Dell Inc. All Rights Reserved.nOS Version: 10.5.0.0nBuild Version: 10.5.0.0.326nBuild Time: 2019-08-07T00:12:30+0000nSystem Type: S4112T- ONnArchitecture: x86_64nUp Time: 02:11:03" ], "stdout_lines": [ [ "Dell EMC Networking OS10 Enterprise", "Copyright (c) 1999-2019 by Dell Inc. All Rights Reserved.", "OS Version: 10.5.0.0", "Build Version: 10.5.0.0.326", "Build Time: 2019-08-07T00:12:30+0000", "System Type: S4112T-ON", "Architecture: x86_64", "Up Time: 02:11:03" ] ] }
  • 6.
    2. Create newVLAN 2.1. Source Code --- - name: Create vlan for LEFT spine hosts: dellos10[0] gather_facts: no tasks: - name: input config for int vlan 11 dellos10_config: lines: - interface vlan 11 - ip address 11.1.1.1/24 - no shutdown - name: input config for po1 dellos10_config: lines: - interface port-channel 1 - switchport trunk allowed vlan 11 - name: Create vlan for RIGHT spine hosts: dellos10[1] gather_facts: no tasks: - name: input config for int vlan 11 dellos10_config: lines: - interface vlan 11 - ip address 11.1.1.2/24 - no shutdown - name: input config for po1 dellos10_config: lines: - interface port-channel 1 - switchport trunk allowed vlan 11 - name: Create vlan for TOR hosts: dellos10[2] gather_facts: no tasks: - name: input config for int vlan 11 dellos10_config: lines: - interface vlan 11 - no shutdown - name: input config for uplink dellos10_config: lines: - interface port-channel 1 - switchport trunk allowed vlan 11 - name: input config for downlink dellos10_config:
  • 7.
    lines: - interface ethernet1/1/27 - switchport trunk allowed vlan 11 - name: Create vlan for Access hosts: dellos10[3] gather_facts: no tasks: - name: input config for int vlan 11 dellos10_config: lines: - interface vlan 11 - ip address 11.1.1.4/24 - no shutdown - name: input config for uplink dellos10_config: lines: - 'interface ethernet 1/1/13:1' - switchport trunk allowed vlan 11 [Code 2-1] 2.cr_vlan.yml 2.2. Run the Code Note: anp = ansible-playbook (alias) [vagrant@ansible-server ~]$ anp cr_vlan.yml PLAY [Create vlan for LEFT spine] ********************************************* TASK [input config for int vlan 11] ******************************************* changed: [172.16.1.1] TASK [input config for po1] *************************************************** changed: [172.16.1.1] PLAY [Create vlan for RIGHT spine] ******************************************** TASK [input config for int vlan 11] ******************************************* changed: [172.16.1.2] TASK [input config for po1] *************************************************** changed: [172.16.1.2] PLAY [Create vlan for TOR] **************************************************** TASK [input config for int vlan 11] ******************************************* changed: [172.16.1.3] TASK [input config for uplink] ************************************************ changed: [172.16.1.3] TASK [input config for downlink] ********************************************** changed: [172.16.1.3]
  • 8.
    PLAY [Create vlanfor Access] ************************************************* TASK [input config for int vlan 11] ******************************************* changed: [172.16.1.4] TASK [input config for uplink] ************************************************ changed: [172.16.1.4] PLAY RECAP ******************************************************************** 172.16.1.1 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 172.16.1.2 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 172.16.1.3 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 172.16.1.4 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 2.3. Check Status [ Access: ping to left Spine ] S4112T# ping 11.1.1.1 PING 11.1.1.1 (11.1.1.1) 56(84) bytes of data. 64 bytes from 11.1.1.1: icmp_seq=1 ttl=64 time=1.02 ms 64 bytes from 11.1.1.1: icmp_seq=2 ttl=64 time=0.984 ms 64 bytes from 11.1.1.1: icmp_seq=3 ttl=64 time=0.983 ms ^C --- 11.1.1.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 0.983/0.997/1.025/0.032 ms [ Access: ping to right Spine ] S4112T# ping 11.1.1.2 PING 11.1.1.2 (11.1.1.2) 56(84) bytes of data. 64 bytes from 11.1.1.2: icmp_seq=1 ttl=64 time=0.891 ms 64 bytes from 11.1.1.2: icmp_seq=2 ttl=64 time=0.835 ms 64 bytes from 11.1.1.2: icmp_seq=3 ttl=64 time=0.957 ms ^C --- 11.1.1.2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2009ms rtt min/avg/max/mdev = 0.835/0.894/0.957/0.055 ms
  • 9.
    3. Config BFD 3.1.Source Code --- - name: Config BFD for LEFT spine hosts: dellos10[0] gather_facts: no tasks: - name: input config for loopback0 dellos10_config: lines: - interface loopback 0 - ip address 1.1.1.1/32 - no shutdown - name: input config for routing dellos10_config: lines: - ip route 4.4.4.4/32 11.1.1.4 - name: Config BFD for RIGHT spine hosts: dellos10[1] gather_facts: no tasks: - name: input config for loopback0 dellos10_config: lines: - interface loopback 0 - ip address 2.2.2.2/32 - no shutdown - name: input config for routing dellos10_config: lines: - ip route 4.4.4.4/32 11.1.1.4 - name: Config BFD for Access hosts: dellos10[3] gather_facts: no tasks: - name: input config for loopback0 dellos10_config: lines: - interface loopback 0 - ip address 4.4.4.4/32 - no shutdown - name: input config for routing dellos10_config: lines: - ip route 1.1.1.1/32 11.1.1.1 - ip route 2.2.2.2/32 11.1.1.2 [Code 3-1] 3.cfg_BFD.yml
  • 10.
    3.2. Run theCode Note: anp = ansible-playbook (alias) [vagrant@ansible-server ~]$ anp 3.cfg_BFD.yml PLAY [Config BFD for LEFT spine] ********************************************** TASK [input config for loopback0] ********************************************* changed: [172.16.1.1] TASK [input config for routing] *********************************************** changed: [172.16.1.1] PLAY [Config BFD for RIGHT spine] ********************************************* TASK [input config for loopback0] ********************************************* changed: [172.16.1.2] TASK [input config for routing] *********************************************** changed: [172.16.1.2] PLAY [Config BFD for Access] ************************************************** TASK [input config for loopback0] ********************************************* changed: [172.16.1.4] TASK [input config for routing] *********************************************** changed: [172.16.1.4] PLAY RECAP ******************************************************************** 172.16.1.1 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 172.16.1.2 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 172.16.1.4 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 3.3. Check Status [ Left Spine : show bfd neighbors ] S4048-1# show bfd neighbors * - Active session role ----------------------------------------------------------------------------------------- LocalAddr RemoteAddr Interface State RxInt TxInt Mult VRF Clients ----------------------------------------------------------------------------------------- * 10.1.1.1 10.1.1.4 vlan10 up 200 200 3 default rtmv4 * 11.1.1.1 11.1.1.4 vlan11 up 200 200 3 default rtmv4 [ Right Spine : show bfd neighbors ] S4048-2# show bfd neighbors * - Active session role ----------------------------------------------------------------------------------------- LocalAddr RemoteAddr Interface State RxInt TxInt Mult VRF Clients ----------------------------------------------------------------------------------------- * 10.1.1.2 10.1.1.4 vlan10 up 200 200 3 default rtmv4 * 11.1.1.2 11.1.1.4 vlan11 up 200 200 3 default rtmv4
  • 11.
    [ Access: showbfd neighbors ] S4112T# show bfd neighbors * - Active session role ----------------------------------------------------------------------------------------- LocalAddr RemoteAddr Interface State RxInt TxInt Mult VRF Clients ----------------------------------------------------------------------------------------- * 10.1.1.4 10.1.1.1 vlan10 up 200 200 3 default rtmv4 * 10.1.1.4 10.1.1.2 vlan10 up 200 200 3 default rtmv4 * 11.1.1.4 11.1.1.1 vlan11 up 200 200 3 default rtmv4 * 11.1.1.4 11.1.1.2 vlan11 up 200 200 3 default rtmv4