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