summaryrefslogtreecommitdiffstats
path: root/system-container/root
diff options
context:
space:
mode:
authorSteve Milner <smilner@redhat.com>2017-03-20 11:08:07 -0400
committerGiuseppe Scrivano <gscrivan@redhat.com>2017-05-03 13:01:50 +0200
commit11e470c7e198c3260c4bf66a069e2b7f8e21e519 (patch)
treeab954b8001565595824a3daa522b1340f6cb9628 /system-container/root
parent28c75e6e5c02ee0c796d378846c2ad8f7a3a8c22 (diff)
downloadopenshift-11e470c7e198c3260c4bf66a069e2b7f8e21e519.tar.gz
openshift-11e470c7e198c3260c4bf66a069e2b7f8e21e519.tar.bz2
openshift-11e470c7e198c3260c4bf66a069e2b7f8e21e519.tar.xz
openshift-11e470c7e198c3260c4bf66a069e2b7f8e21e519.zip
installer: Add system container variable for log saving
A new environment variable, VAR_LOG_ANSIBLE_LOG, was created to allow the installer to bind mount the location and write the log back to the host. By default the value is /var/log/ansible.log Example: atomic install --system --set INVENTORY_FILE=$(pwd)/hosts.inventory \ --set SSH_ROOT=/root/.ssh \ --set VAR_LOG_ANSIBLE_LOG=/some/log/location/ansible.log \ --set PLAYBOOK_FILE=./playbooks/byo/config.yml openshift-ansible
Diffstat (limited to 'system-container/root')
-rw-r--r--system-container/root/exports/config.json.template10
-rw-r--r--system-container/root/exports/manifest.json1
-rw-r--r--system-container/root/exports/tmpfiles.template1
-rwxr-xr-xsystem-container/root/usr/local/bin/run-system-container.sh1
4 files changed, 13 insertions, 0 deletions
diff --git a/system-container/root/exports/config.json.template b/system-container/root/exports/config.json.template
index ede2414c1..383e3696e 100644
--- a/system-container/root/exports/config.json.template
+++ b/system-container/root/exports/config.json.template
@@ -131,6 +131,16 @@
]
},
{
+ "type": "bind",
+ "source": "$VAR_LOG_OPENSHIFT_LOG",
+ "destination": "/var/log/ansible.log",
+ "options": [
+ "bind",
+ "rw",
+ "mode=755"
+ ]
+ },
+ {
"destination": "/root/.ansible",
"type": "tmpfs",
"source": "tmpfs",
diff --git a/system-container/root/exports/manifest.json b/system-container/root/exports/manifest.json
index 615b53261..1db845965 100644
--- a/system-container/root/exports/manifest.json
+++ b/system-container/root/exports/manifest.json
@@ -3,6 +3,7 @@
"defaultValues": {
"OPTS": "",
"VAR_LIB_OPENSHIFT_INSTALLER" : "/var/lib/openshift-installer",
+ "VAR_LOG_OPENSHIFT_LOG": "/var/log/ansible.log",
"PLAYBOOK_FILE": "/usr/share/ansible/openshift-ansible/playbooks/byo/config.yml",
"SSH_ROOT": "/root/.ssh",
"INVENTORY_FILE": "/dev/null"
diff --git a/system-container/root/exports/tmpfiles.template b/system-container/root/exports/tmpfiles.template
index 327e6f45d..b1f6caf47 100644
--- a/system-container/root/exports/tmpfiles.template
+++ b/system-container/root/exports/tmpfiles.template
@@ -1 +1,2 @@
d $VAR_LIB_OPENSHIFT_INSTALLER - - - - -
+f $VAR_LOG_OPENSHIFT_LOG - - - - -
diff --git a/system-container/root/usr/local/bin/run-system-container.sh b/system-container/root/usr/local/bin/run-system-container.sh
index 75dbfde03..9ce7c7328 100755
--- a/system-container/root/usr/local/bin/run-system-container.sh
+++ b/system-container/root/usr/local/bin/run-system-container.sh
@@ -1,3 +1,4 @@
#!/bin/sh
+export ANSIBLE_LOG_PATH=/var/log/ansible.log
exec ansible-playbook -i /etc/ansible/hosts ${OPTS} ${PLAYBOOK_FILE}