summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorMichal Ptacek <m.ptacek@partner.samsung.com>2019-01-18 10:44:05 +0000
committerGerrit Code Review <gerrit@onap.org>2019-01-18 10:44:05 +0000
commit0dc5cac61b64f3e395b3ea91f50fb85996a942e8 (patch)
tree2c07ca18fba2b37e2a708732928472637170cf73 /ansible
parentb5cd82b2ec6f4fe69eae27f70eb3b5eda52da368 (diff)
parent5b197fbca6b960060c1b3ade5560b4cfbc1c4848 (diff)
Merge "Fix logging problem for ansible-playbook"
Diffstat (limited to 'ansible')
-rw-r--r--ansible/ansible.cfg1
-rwxr-xr-xansible/run_playbook.sh6
2 files changed, 7 insertions, 0 deletions
diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg
index c2ee3ff3..0978b814 100644
--- a/ansible/ansible.cfg
+++ b/ansible/ansible.cfg
@@ -6,3 +6,4 @@
# relative path ./application is mapped into ansible container under
# /ansible/application where application roles should be found
roles_path = /ansible/application
+log_path = /ansible/log/ansible.log
diff --git a/ansible/run_playbook.sh b/ansible/run_playbook.sh
index 9a2ca56f..2edbe358 100755
--- a/ansible/run_playbook.sh
+++ b/ansible/run_playbook.sh
@@ -25,6 +25,7 @@ script_path=$(readlink -f "$0")
script_name=$(basename "$script_path")
ANSIBLE_DIR=$(dirname "$script_path")
ANSIBLE_CHROOT="${ANSIBLE_DIR}/ansible_chroot"
+ANSIBLE_LOG_PATH="/ansible/log/ansible-$(date +%Y.%m.%d-%H%M%S).log"
#
@@ -82,6 +83,8 @@ REQUIREMENTS:
# run playbook
#
+export ANSIBLE_LOG_PATH
+
# if no arg then print help and exit
if [ -z "$1" ] ; then
help
@@ -101,6 +104,8 @@ if [ -n "$ANSIBLE_DOCKER_IMAGE" ] ; then
-v "$ANSIBLE_DIR:/ansible:ro" \
-v "$ANSIBLE_DIR/application:/ansible/application:rw" \
-v "$ANSIBLE_DIR/certs/:/certs:rw" \
+ -v "$ANSIBLE_DIR/log/:/ansible/log:rw" \
+ -e ANSIBLE_LOG_PATH \
-it "${ANSIBLE_DOCKER_IMAGE}" "$@"
fi
@@ -123,6 +128,7 @@ fi
--mount rw:"${HOME}/.ssh":/root/.ssh \
--mount ro:"$ANSIBLE_DIR":/ansible \
--mount rw:"$ANSIBLE_DIR"/application:/ansible/application \
+ --mount rw:"$ANSIBLE_DIR"/log:/ansible/log \
--mount rw:"$ANSIBLE_DIR"/certs:/certs \
--mount ro:/etc/resolv.conf:/etc/resolv.conf \
--mount ro:/etc/hosts:/etc/hosts \