From a15509f999a27482c731dc501ccfa6f2e647a227 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= <cjeanner@redhat.com>
Date: Tue, 8 Jan 2019 11:14:41 +0100
Subject: [PATCH] Ensure /var/lib/iscsi actually exists before mounting it

Change I803ed2ba9ff52f9a02c550a28d21cc9102568c8e adds this directory
as bind-mount for many services, but there is no guarantee this directory
actually exists on the node.

This might break the deploy, as it will prevent the iscsi container to
start as expected when using podman.

Although this directory is managed by a package (iscsi-initiator-utils),
this one isn't always present (i.e. on undercloud, or deployed servers,
or standalone).

Related-Bug: #1810338
Change-Id: I8fc52b2a872fd77b342a0f20e4602b21d9e33fed
---
 docker/services/iscsid.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docker/services/iscsid.yaml b/docker/services/iscsid.yaml
index b0810120e5..a809f9716c 100644
--- a/docker/services/iscsid.yaml
+++ b/docker/services/iscsid.yaml
@@ -109,6 +109,11 @@ outputs:
             path: /etc/iscsi
             state: directory
             setype: svirt_sandbox_file_t
+        - name: ensure /var/lib/iscsi exists
+          file:
+            path: /var/lib/iscsi
+            state: directory
+            setype: svirt_sandbox_file_t
         - name: stat /lib/systemd/system/iscsid.socket
           stat: path=/lib/systemd/system/iscsid.socket
           register: stat_iscsid_socket