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 | --- |
Jonathan Hart | 1728fc8 | 2017-08-22 12:47:10 -0700 | [diff] [blame] | 17 | # We want to kill old agents and stop the old OFDPA service before removing |
| 18 | - name: OpenFlow Agent Is Not Running |
| 19 | command: killall ofagentapp |
| 20 | failed_when: false |
| 21 | tags: |
| 22 | - skip_ansible_lint # there's no harm to run killall if process is not running |
| 23 | |
| 24 | - name: Old OFDPA Is Not Running |
| 25 | command: killall -9 brcm-indigo-ofdpa-ofagent |
| 26 | failed_when: false |
| 27 | tags: |
| 28 | - 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] | 29 | |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 30 | - name: Verify Service Exists |
| 31 | stat: |
| 32 | path: /etc/init.d/ofdpa |
| 33 | register: ofdpa_stat |
| 34 | changed_when: false |
| 35 | failed_when: false |
| 36 | |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 37 | - name: OpenFlow Agent Stopped |
| 38 | service: name=ofdpa state=stopped |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 39 | when: ofdpa_stat.stat.exists |
| 40 | |
Jonathan Hart | 1728fc8 | 2017-08-22 12:47:10 -0700 | [diff] [blame] | 41 | - name: OFDPA 3.0 EA0 Is Not Present |
| 42 | apt: |
| 43 | name: ofdpa-3.0-ea0 |
| 44 | state: absent |
| 45 | force: yes |
| 46 | purge: yes |
| 47 | |
| 48 | - name: Verify Distribution Release File |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 49 | stat: |
| 50 | path: /etc/lsb-release |
| 51 | register: lsb_stat |
| 52 | changed_when: false |
| 53 | failed_when: false |
| 54 | |
Luca Prete | 57e7627 | 2017-12-11 14:15:08 -0800 | [diff] [blame] | 55 | - name: Verify Distribute Release Name |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 56 | shell: grep -i ubuntu /etc/lsb-release | wc -l |
| 57 | register: dist |
| 58 | changed_when: false |
| 59 | failed_when: false |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 60 | |
Luca Prete | 57e7627 | 2017-12-11 14:15:08 -0800 | [diff] [blame] | 61 | - name: Utilities Scripts |
| 62 | template: |
| 63 | src: "{{ item }}" |
| 64 | dest: /root |
| 65 | owner: root |
| 66 | group: root |
| 67 | mode: "0755" |
| 68 | with_items: |
| 69 | - killit |
| 70 | - connect |