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 |
| 18 | shell: ofdpa --version |
| 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 | |
| 23 | - name: Version I.12.1.1+1.1 Openflow Agent |
| 24 | include: ofdpa.yml |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 25 | when: ofdpa_exists.stdout == "0" or ofdpa_version.stdout.find('version I.12.1.1+1.1') == -1 |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 26 | |
| 27 | - name: Utilities Scripts |
| 28 | template: |
| 29 | src: files/{{ item }} |
| 30 | dest: /root |
| 31 | owner: root |
| 32 | group: root |
| 33 | mode: 0755 |
| 34 | with_items: |
| 35 | - purge |
| 36 | - killit |
| 37 | - connect |
| 38 | - reset |
| 39 | register: utils |
| 40 | |
| 41 | - name: Mark Persistent |
| 42 | command: persist {{ item }} |
| 43 | with_items: |
| 44 | - purge |
| 45 | - killit |
| 46 | - connect |
| 47 | - reset |
| 48 | when: utils.changed |
| 49 | |
| 50 | - name: Persist |
| 51 | command: savepersist |
| 52 | when: utils.changed |
| 53 | failed_when: false |