David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 1 | --- |
| 2 | - name: Openflow Agent Debian Archive |
| 3 | get_url: |
| 4 | url: http://github.com/ciena/ZeroTouchProvisioning/raw/master/ofdpa-i.12.1.1_12.1.1%2Baccton1.7-1_amd64.deb |
| 5 | validate_certs: false |
| 6 | dest: /mnt/flash2/ofdpa-i.12.1.1_12.1.1%2Baccton1.7-1_amd64.deb |
| 7 | |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame^] | 8 | - name: Verify Service Exists |
| 9 | stat: |
| 10 | path: /etc/init.d/ofdpa |
| 11 | register: ofdpa_stat |
| 12 | changed_when: false |
| 13 | failed_when: false |
| 14 | |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 15 | - name: OpenFlow Agent Stopped |
| 16 | service: name=ofdpa state=stopped |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame^] | 17 | when: ofdpa_stat.stat.exists |
| 18 | |
| 19 | - name: Verify Distributeion Release File |
| 20 | stat: |
| 21 | path: /etc/lsb-release |
| 22 | register: lsb_stat |
| 23 | changed_when: false |
| 24 | failed_when: false |
| 25 | |
| 26 | - name: Verify Distribute Name |
| 27 | shell: grep -i ubuntu /etc/lsb-release | wc -l |
| 28 | register: dist |
| 29 | changed_when: false |
| 30 | failed_when: false |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 31 | |
| 32 | - name: Openflow Agent |
| 33 | apt: deb="/mnt/flash2/ofdpa-i.12.1.1_12.1.1%2Baccton1.7-1_amd64.deb" force=true |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame^] | 34 | when: not lsb_stat.stat.exists or dist.stdout == "0" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 35 | |
| 36 | - name: OpenFlow Agent Started |
| 37 | service: name=ofdpa state=started |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame^] | 38 | when: not lsb_stat.stat.exists or dist.stdout == "0" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 39 | |
| 40 | - name: Mark Persist Openflow Agent |
| 41 | command: persist /etc/accton/ofdpa.conf |
| 42 | |
| 43 | - name: Persist Openflow Agent |
| 44 | command: savepersist |
| 45 | failed_when: false |