|
1 | 1 | ############################################################################################## |
2 | 2 | ### playbook to deploy the fanout swtich |
3 | | -### Use this playbook to deploy the VLAN configurations of fanout leaf switch in SONiC testbed |
| 3 | +### Use this playbook to deploy the VLAN configurations of fanout switch in SONiC testbed |
4 | 4 | ### This playbook will run based on hardware flatform. Each fanout switch hardware type has its |
5 | 5 | ### own unique feature and configuration command or format. Unless you use the hardware swtich |
6 | 6 | ### specified in this playbook, you would need to come up with your own fanout switch deployment |
7 | 7 | ### playbook |
8 | 8 | ################################################################################################ |
9 | | - # Gather minigraph facts |
| 9 | +# Deploy fanout switch |
10 | 10 | - name: Gathering lab graph facts about the device |
11 | 11 | conn_graph_facts: host={{ inventory_hostname }} |
12 | 12 | connection: local |
13 | | - tags: always |
| 13 | + |
| 14 | +- set_fact: sw_type="{{ device_info['Type'] }}" |
14 | 15 |
|
15 | 16 | - name: prepare fanout switch admin login info |
16 | 17 | set_fact: ansible_ssh_user={{ fanout_admin_user }} ansible_ssh_pass={{ fanout_admin_password }} |
17 | 18 |
|
18 | | -- block: |
19 | | - - name: build fanout startup config for Arista Fanout leaf |
20 | | - template: src=arista_7260_deploy.j2 |
21 | | - dest=/mnt/flash/startup-config |
22 | | - notify: |
23 | | - - Restart the box |
| 19 | +- name: create persistent shell login |
| 20 | + file: path=/mnt/flash/rc.eos state=touch |
| 21 | + become: yes |
| 22 | + |
| 23 | +- name: save persistent shell login |
| 24 | + template: src=rc.eos.j2 |
| 25 | + dest=/mnt/flash/rc.eos |
| 26 | + become: yes |
| 27 | + |
| 28 | +- name: build fanout startup config for Arista fanout leaf |
| 29 | + template: src=arista_7260_deploy.j2 |
| 30 | + dest=/mnt/flash/startup-config |
24 | 31 | when: device_info.HwSku == "Arista-7260QX-64" |
| 32 | + become: yes |
25 | 33 |
|
| 34 | +- name: build fanout startup config for 7060 |
| 35 | + template: src=arista_7060_deploy.j2 |
| 36 | + dest=/mnt/flash/startup-config |
| 37 | + when: device_info.HwSku == "Arista-7060CX-32S" |
| 38 | + become: yes |
26 | 39 |
|
27 | | -- name: build fanout startup config |
28 | | - action: apswitch template=force10_s6100_deploy.j2 |
29 | | - connection: switch |
30 | | - args: |
31 | | - login: "{{ switch_login['Force10'] }}" |
32 | | - when: device_info.HwSku == "Force10-S6100" |
| 40 | +- name: reboot |
| 41 | + shell: sleep 2 && shutdown -r now "Reboot" |
| 42 | + async: 1 |
| 43 | + poll: 0 |
| 44 | + ignore_errors: true |
| 45 | + become: yes |
33 | 46 |
|
34 | 47 | - block: |
35 | | - - name: build fanout startup config |
36 | | - template: src=arista_7060_deploy.j2 |
37 | | - dest=/mnt/flash/startup-config |
38 | | - notify: |
39 | | - - Restart the box |
40 | | - when: device_info.HwSku == "Arista-7060CX-32S" |
| 48 | + - set_fact: |
| 49 | + leaf_name: "{{ inventory_hostname }}" |
| 50 | + leaf: "{{ ansible_host }}" |
41 | 51 |
|
| 52 | + - include: rootfanout_connect.yml |
| 53 | + deploy_leaf=true |
| 54 | + when: sw_type == 'FanoutLeaf' |
0 commit comments