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 | |
| 16 | |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 17 | --- |
| 18 | - name: Openflow Agent Debian Archive |
| 19 | get_url: |
Charles Chan | 4016b8f | 2017-01-04 11:11:23 -0800 | [diff] [blame] | 20 | url: https://github.com/onfsdn/atrium-docs/raw/master/16A/ONOS/builds/ofdpa-3.0-ea0_3.0.0.0%2Baccton1.0-1_amd64.deb |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 21 | validate_certs: false |
Charles Chan | 4016b8f | 2017-01-04 11:11:23 -0800 | [diff] [blame] | 22 | dest: /mnt/onl/data/ofdpa-3.0-ea0_3.0.0.0+accton1.0-1_amd64.deb |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 23 | |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 24 | - name: Verify Service Exists |
| 25 | stat: |
| 26 | path: /etc/init.d/ofdpa |
| 27 | register: ofdpa_stat |
| 28 | changed_when: false |
| 29 | failed_when: false |
| 30 | |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 31 | - name: OpenFlow Agent Stopped |
| 32 | service: name=ofdpa state=stopped |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 33 | when: ofdpa_stat.stat.exists |
| 34 | |
| 35 | - name: Verify Distributeion Release File |
| 36 | stat: |
| 37 | path: /etc/lsb-release |
| 38 | register: lsb_stat |
| 39 | changed_when: false |
| 40 | failed_when: false |
| 41 | |
| 42 | - name: Verify Distribute Name |
| 43 | shell: grep -i ubuntu /etc/lsb-release | wc -l |
| 44 | register: dist |
| 45 | changed_when: false |
| 46 | failed_when: false |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 47 | |
| 48 | - name: Openflow Agent |
Charles Chan | 4016b8f | 2017-01-04 11:11:23 -0800 | [diff] [blame] | 49 | apt: deb="/mnt/onl/data/ofdpa-3.0-ea0_3.0.0.0+accton1.0-1_amd64.deb" force=true |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 50 | when: not lsb_stat.stat.exists or dist.stdout == "0" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 51 | |
| 52 | - name: OpenFlow Agent Started |
| 53 | service: name=ofdpa state=started |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 54 | when: not lsb_stat.stat.exists or dist.stdout == "0" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 55 | |