diff --git a/docker/services/opendaylight-api.yaml b/docker/services/opendaylight-api.yaml index cb3d9843ed..274f42d6ff 100644 --- a/docker/services/opendaylight-api.yaml +++ b/docker/services/opendaylight-api.yaml @@ -145,6 +145,10 @@ outputs: metadata_settings: get_attr: [OpenDaylightBase, role_data, metadata_settings] host_prep_tasks: + - name: Delete cache folder + file: + path: /var/lib/opendaylight/data/cache + state: absent - name: create persistent directories file: path: "{{ item }}" @@ -181,8 +185,12 @@ outputs: # Containerized deployment upgrade steps - name: ODL container L2 update and upgrade tasks block: &odl_container_upgrade_tasks - - name: remove data, journal and snapshots + - name: stop previous ODL container + docker_container: + name: opendaylight_api + state: stopped when: step|int == 0 + - name: remove data, journal and snapshots file: path: /var/lib/opendaylight/{{item}} state: absent @@ -190,6 +198,7 @@ outputs: - snapshots - journal - data + when: step|int == 0 - name: Set ODL upgrade flag to True copy: dest: /var/lib/config-data/puppet-generated/opendaylight/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-mdsalutil-config.xml @@ -231,6 +240,19 @@ outputs: - name: store update level to update_level variable set_fact: odl_update_level: {get_param: ODLUpdateLevel} + - name: Stop ODL container and remove cache + block: + - name: Stop previous ODL container + docker_container: + name: opendaylight_api + state: stopped + - name: Delete cache folder + file: + path: /var/lib/opendaylight/data/cache + state: absent + when: + - step|int == 0 + - odl_update_level == 1 - name: Run L2 update tasks that are similar to upgrade_tasks when update level is 2 block: *odl_container_upgrade_tasks when: odl_update_level == 2 diff --git a/releasenotes/notes/fix-odl-update-upgrade-cache-83004abe108971c1.yaml b/releasenotes/notes/fix-odl-update-upgrade-cache-83004abe108971c1.yaml new file mode 100644 index 0000000000..e7eaafca1e --- /dev/null +++ b/releasenotes/notes/fix-odl-update-upgrade-cache-83004abe108971c1.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes update and upgrade along with modifying configuration for + OpenDaylight deployments. See + https://bugs.launchpad.net/tripleo/+bug/1775919