| |
| # Copyright 2017-present Open Networking Foundation |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| --- |
| # We want to kill old agents and stop the old OFDPA service before removing |
| - name: OpenFlow Agent Is Not Running |
| command: killall ofagentapp |
| failed_when: false |
| tags: |
| - skip_ansible_lint # there's no harm to run killall if process is not running |
| |
| - name: Old OFDPA Is Not Running |
| command: killall -9 brcm-indigo-ofdpa-ofagent |
| failed_when: false |
| tags: |
| - skip_ansible_lint # there's no harm to run killall if process is not running |
| |
| - name: Verify Service Exists |
| stat: |
| path: /etc/init.d/ofdpa |
| register: ofdpa_stat |
| changed_when: false |
| failed_when: false |
| |
| - name: OpenFlow Agent Stopped |
| service: name=ofdpa state=stopped |
| when: ofdpa_stat.stat.exists |
| |
| - name: OFDPA 3.0 EA0 Is Not Present |
| apt: |
| name: ofdpa-3.0-ea0 |
| state: absent |
| force: yes |
| purge: yes |
| |
| - name: Verify Distribution Release File |
| stat: |
| path: /etc/lsb-release |
| register: lsb_stat |
| changed_when: false |
| failed_when: false |
| |
| - name: Verify Distribute Release Name |
| shell: grep -i ubuntu /etc/lsb-release | wc -l |
| register: dist |
| changed_when: false |
| failed_when: false |
| |
| - name: Utilities Scripts |
| template: |
| src: "{{ item }}" |
| dest: /root |
| owner: root |
| group: root |
| mode: "0755" |
| with_items: |
| - killit |
| - connect |