blob: ef1e0ab9629444d2fb0b8fc3d63e1b1fdfb96289 [file] [log] [blame]
Charles Chana4ccbde2016-08-02 00:12:34 -07001---
2- name: Locate all switches
3 hosts: localhost
4 tasks:
5 - name: Lookup DHCP harvest
Charles Chan86616c92016-09-13 13:05:57 -07006 shell: cat /etc/bind/maas/dhcp_harvest.inc | grep -i " cc:37:ab\| 70:72:cf" | awk '{print $1}'
Charles Chana4ccbde2016-08-02 00:12:34 -07007 register: switches
David K. Bainbridge17248c02016-08-29 17:04:34 -07008 changed_when: false
Charles Chana4ccbde2016-08-02 00:12:34 -07009 - name: Add hosts into inventory
10 add_host: name={{item}} group=fabric
11 with_items: "{{switches.stdout_lines}}"
12
13- name: Connect all fabric switches to onos-fabric
14 hosts: fabric
15 remote_user: root
16 tasks:
17 - name: Check the status of indigo agent
18 command: ps aux
19 changed_when: false
20 register: status
21
22 - name: Terminate indigo agent
23 command: /root/killit
24 when: status.stdout.find('brcm-indigo-ofdpa-ofagent') != -1
25
26 - name: Purge hardware tables
27 command: /root/purge
David K. Bainbridge17248c02016-08-29 17:04:34 -070028 changed_when: true
Charles Chana4ccbde2016-08-02 00:12:34 -070029
30 - name: Start indigo agent
31 command: /root/connect -bg
David K. Bainbridge17248c02016-08-29 17:04:34 -070032 changed_when: true
Charles Chana4ccbde2016-08-02 00:12:34 -070033
34 - name: Verify indigo agent has been started
35 command: ps aux
36 changed_when: false
37 register: status
38 failed_when: status.stdout.find('brcm-indigo-ofdpa-ofagent') == -1