blob: ace1f2be3b6506d93bc0183db83a9f7e6b13a571 [file] [log] [blame]
Jonathan Hart93956f52017-08-22 13:12:42 -07001
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. Bainbridge317e7d72016-05-11 08:31:44 -070016---
17- name: Openflow Agent Debian Archive
18 get_url:
Jonathan Hart1728fc82017-08-22 12:47:10 -070019 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. Bainbridge317e7d72016-05-11 08:31:44 -070020 validate_certs: false
Jonathan Hart1728fc82017-08-22 12:47:10 -070021 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. Bainbridge317e7d72016-05-11 08:31:44 -070036
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070037- 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. Bainbridge317e7d72016-05-11 08:31:44 -070044- name: OpenFlow Agent Stopped
45 service: name=ofdpa state=stopped
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070046 when: ofdpa_stat.stat.exists
47
Jonathan Hart1728fc82017-08-22 12:47:10 -070048- 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. Bainbridgebe58a0d2016-06-22 15:43:02 -070056 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. Bainbridge317e7d72016-05-11 08:31:44 -070067
Jonathan Hart1728fc82017-08-22 12:47:10 -070068- 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. Bainbridgebe58a0d2016-06-22 15:43:02 -070070 when: not lsb_stat.stat.exists or dist.stdout == "0"