Charles Chan | a4ccbde | 2016-08-02 00:12:34 -0700 | [diff] [blame] | 1 | --- |
| 2 | - name: Locate all switches |
| 3 | hosts: localhost |
| 4 | tasks: |
| 5 | - name: Lookup DHCP harvest |
| 6 | shell: cat /etc/bind/maas/dhcp_harvest.inc | grep -i " cc:37:ab\| 70:72;cf" | awk '{print $1}' |
| 7 | register: switches |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame^] | 8 | changed_when: false |
Charles Chan | a4ccbde | 2016-08-02 00:12:34 -0700 | [diff] [blame] | 9 | - 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. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame^] | 28 | changed_when: true |
Charles Chan | a4ccbde | 2016-08-02 00:12:34 -0700 | [diff] [blame] | 29 | |
| 30 | - name: Start indigo agent |
| 31 | command: /root/connect -bg |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame^] | 32 | changed_when: true |
Charles Chan | a4ccbde | 2016-08-02 00:12:34 -0700 | [diff] [blame] | 33 | |
| 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 |