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 | --- |
| 17 | - name: Openflow Agent Debian Archive |
| 18 | get_url: |
Jonathan Hart | 1728fc8 | 2017-08-22 12:47:10 -0700 | [diff] [blame] | 19 | url: https://github.com/onfsdn/atrium-docs/blob/master/16A/ONOS/builds/ofdpa_3.0.4.0+accton1.0~1-1_amd64.deb?raw=true |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 20 | validate_certs: false |
Jonathan Hart | 1728fc8 | 2017-08-22 12:47:10 -0700 | [diff] [blame] | 21 | checksum: "sha256:e0b10051b2032454132c6634a0896883e1548e0c39b847ff10933e559b95a729" |
| 22 | dest: /mnt/onl/data/ofdpa_3.0.4.0+accton1.0~1-1_amd64.deb |
| 23 | |
| 24 | # We want to kill old agents and stop the old OFDPA service before removing |
| 25 | - name: OpenFlow Agent Is Not Running |
| 26 | command: killall ofagentapp |
| 27 | failed_when: false |
| 28 | tags: |
| 29 | - skip_ansible_lint # there's no harm to run killall if process is not running |
| 30 | |
| 31 | - name: Old OFDPA Is Not Running |
| 32 | command: killall -9 brcm-indigo-ofdpa-ofagent |
| 33 | failed_when: false |
| 34 | tags: |
| 35 | - skip_ansible_lint # there's no harm to run killall if process is not running |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 36 | |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 37 | - name: Verify Service Exists |
| 38 | stat: |
| 39 | path: /etc/init.d/ofdpa |
| 40 | register: ofdpa_stat |
| 41 | changed_when: false |
| 42 | failed_when: false |
| 43 | |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 44 | - name: OpenFlow Agent Stopped |
| 45 | service: name=ofdpa state=stopped |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 46 | when: ofdpa_stat.stat.exists |
| 47 | |
Jonathan Hart | 1728fc8 | 2017-08-22 12:47:10 -0700 | [diff] [blame] | 48 | - name: OFDPA 3.0 EA0 Is Not Present |
| 49 | apt: |
| 50 | name: ofdpa-3.0-ea0 |
| 51 | state: absent |
| 52 | force: yes |
| 53 | purge: yes |
| 54 | |
| 55 | - name: Verify Distribution Release File |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 56 | stat: |
| 57 | path: /etc/lsb-release |
| 58 | register: lsb_stat |
| 59 | changed_when: false |
| 60 | failed_when: false |
| 61 | |
| 62 | - name: Verify Distribute Name |
| 63 | shell: grep -i ubuntu /etc/lsb-release | wc -l |
| 64 | register: dist |
| 65 | changed_when: false |
| 66 | failed_when: false |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 67 | |
Jonathan Hart | 1728fc8 | 2017-08-22 12:47:10 -0700 | [diff] [blame] | 68 | - name: Openflow Agent Installed |
| 69 | apt: deb="/mnt/onl/data/ofdpa_3.0.4.0+accton1.0~1-1_amd64.deb" force=true |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 70 | when: not lsb_stat.stat.exists or dist.stdout == "0" |