From 9cc52fae4cb58819b3ed42eb9828258871874794 Mon Sep 17 00:00:00 2001 From: Janki Chhatbar Date: Tue, 23 Oct 2018 16:16:45 +0530 Subject: [PATCH] Delete empty karaf directory on host Mounting empty /var/lib/config-data/puppet-generated/ opendaylight/opt/opendaylight/etc/opendaylight/karaf from host to /opt/opendaylight/etc/opendaylight/karaf on container empties the folder on container itself. Hence on restart/redeploy, ODL can't find files inside that folder and can't start leading to deployment failure. So delete the empty karaf folder on host so that the contents of karaf folder inside the container is intact durin redeploy. Change-Id: I75aabaa2abc0fc9ba789c53f27fc37cfb7769a8b Closes-Bug: #1799395 --- docker/services/opendaylight-api.yaml | 7 +++++-- ...odl_delete_karaf_folder_on_host-b81465f62fe422d6.yaml | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/odl_delete_karaf_folder_on_host-b81465f62fe422d6.yaml diff --git a/docker/services/opendaylight-api.yaml b/docker/services/opendaylight-api.yaml index f3c236c4e2..c28a951442 100644 --- a/docker/services/opendaylight-api.yaml +++ b/docker/services/opendaylight-api.yaml @@ -149,10 +149,13 @@ outputs: list_concat: - {get_attr: [OpenDaylightApiLogging, host_prep_tasks]} - - - name: Delete cache folder + - name: Delete cache and karaf folder file: - path: /var/lib/opendaylight/data/cache + path: "{{ item }}" state: absent + with_items: + - /var/lib/opendaylight/data/cache + - /var/lib/config-data/puppet-generated/opendaylight/opt/opendaylight/etc/opendaylight/karaf - name: create persistent directories file: path: "{{ item }}" diff --git a/releasenotes/notes/odl_delete_karaf_folder_on_host-b81465f62fe422d6.yaml b/releasenotes/notes/odl_delete_karaf_folder_on_host-b81465f62fe422d6.yaml new file mode 100644 index 0000000000..05defc03ce --- /dev/null +++ b/releasenotes/notes/odl_delete_karaf_folder_on_host-b81465f62fe422d6.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + Empty /var/lib/config-data/puppet-generated/opendaylight/opt/ + opendaylight/etc/opendaylight/karaf directory on host empties + /opt/opendaylight/etc/opendaylight/karaf inside the ODL container + because of the mount. This leads to deployment failure on + redeploy. Delete the empty karaf directory on host before + redeploying.