Jonathan Hart | 93956f5 | 2017-08-22 13:12:42 -0700 | [diff] [blame] | 1 | |
| 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 | |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 17 | --- |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 18 | - name: Generate DPID |
| 19 | shell: ifconfig ma1 | grep HWaddr | awk '{ print "0x0000"$5 }' | sed s/://g |
| 20 | register: dpid |
| 21 | changed_when: false |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 22 | |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 23 | - name: Ensure ofdpa Config |
| 24 | set_fact: |
| 25 | switch_id: "{{ dpid.stdout }}" |
| 26 | controller_ip: "onos-fabric" |
| 27 | |
| 28 | - name: Verify Openflow Agent |
| 29 | shell: which ofdpa | wc -w |
| 30 | register: ofdpa_exists |
| 31 | changed_when: false |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 32 | |
| 33 | - name: Openflow Agent Version |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame] | 34 | command: ofdpa --version |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 35 | register: ofdpa_version |
| 36 | changed_when: false |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 37 | when: ofdpa_exists.stdout != "0" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 38 | |
Charles Chan | 4016b8f | 2017-01-04 11:11:23 -0800 | [diff] [blame] | 39 | # Note: This is the version number of OFDPA 3.0 EA0 |
| 40 | - name: Version 2.0.4.0 Openflow Agent |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 41 | include: ofdpa.yml |
Charles Chan | 4016b8f | 2017-01-04 11:11:23 -0800 | [diff] [blame] | 42 | when: ofdpa_exists.stdout == "0" or ofdpa_version.stdout.find('version 2.0.4.0') == -1 |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 43 | |
| 44 | - name: Utilities Scripts |
| 45 | template: |
David K. Bainbridge | bd1aa67 | 2016-11-09 13:15:29 -0800 | [diff] [blame] | 46 | src: "{{ item }}" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 47 | dest: /root |
| 48 | owner: root |
| 49 | group: root |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 50 | mode: "0755" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 51 | with_items: |
| 52 | - purge |
| 53 | - killit |
| 54 | - connect |
| 55 | - reset |
| 56 | register: utils |
| 57 | |
Charles Chan | aba1b56 | 2016-08-01 16:33:07 -0700 | [diff] [blame] | 58 | - name: Authorize SSH Key |
| 59 | become: yes |
| 60 | authorized_key: |
| 61 | key={{ pub_ssh_key }} |
| 62 | user=root |
| 63 | state=present |
| 64 | register: sshkey |
| 65 | |