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