Add support for plain files mounting into chroot
In this commit I tried to follow a behaviour of docker. If mounted
path does not exist then it will handle it as a directory - it
creates it and the mountpoint is expected to be a directory also.
If the mounted path is a plain file it will do file bind mounting.
The mountpoint must be a plain file.
Change-Id: Ie8b29442c8ebb8da389ba6c9a152a49d8cf6e9be
Issue-ID: OOM-1575
Signed-off-by: Petr Ospalý <p.ospaly@partner.samsung.com>
diff --git a/ansible/run_playbook.sh b/ansible/run_playbook.sh
index 88c86bc..9a2ca56 100755
--- a/ansible/run_playbook.sh
+++ b/ansible/run_playbook.sh
@@ -119,13 +119,13 @@
fi
# run chroot
-mkdir -p "$ANSIBLE_DIR"/application
-mkdir -p "$ANSIBLE_DIR"/certs
"$ANSIBLE_DIR"/docker/run_chroot.sh \
--mount rw:"${HOME}/.ssh":/root/.ssh \
--mount ro:"$ANSIBLE_DIR":/ansible \
--mount rw:"$ANSIBLE_DIR"/application:/ansible/application \
--mount rw:"$ANSIBLE_DIR"/certs:/certs \
+ --mount ro:/etc/resolv.conf:/etc/resolv.conf \
+ --mount ro:/etc/hosts:/etc/hosts \
--workdir /ansible \
execute "$ANSIBLE_CHROOT" ansible-playbook "$@"