blob: 18d9741ff5a9284761d93b8d58852346eaf8b901 [file] [log] [blame]
Jonathan Hart93956f52017-08-22 13:12:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Charles Chana4ccbde2016-08-02 00:12:34 -070017---
18- name: Locate all switches
19 hosts: localhost
20 tasks:
21 - name: Lookup DHCP harvest
Charles Chan86616c92016-09-13 13:05:57 -070022 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 -070023 register: switches
David K. Bainbridge17248c02016-08-29 17:04:34 -070024 changed_when: false
Charles Chana4ccbde2016-08-02 00:12:34 -070025 - name: Add hosts into inventory
26 add_host: name={{item}} group=fabric
27 with_items: "{{switches.stdout_lines}}"
28
29- name: Connect all fabric switches to onos-fabric
30 hosts: fabric
31 remote_user: root
32 tasks:
33 - name: Check the status of indigo agent
34 command: ps aux
35 changed_when: false
36 register: status
37
38 - name: Terminate indigo agent
39 command: /root/killit
40 when: status.stdout.find('brcm-indigo-ofdpa-ofagent') != -1
41
42 - name: Purge hardware tables
43 command: /root/purge
David K. Bainbridge17248c02016-08-29 17:04:34 -070044 changed_when: true
Charles Chana4ccbde2016-08-02 00:12:34 -070045
46 - name: Start indigo agent
47 command: /root/connect -bg
David K. Bainbridge17248c02016-08-29 17:04:34 -070048 changed_when: true
Charles Chana4ccbde2016-08-02 00:12:34 -070049
50 - name: Verify indigo agent has been started
51 command: ps aux
52 changed_when: false
53 register: status
54 failed_when: status.stdout.find('brcm-indigo-ofdpa-ofagent') == -1