Skip to content

Commit

Permalink
installer: Add system container variable for log saving
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ashcrow authored and giuseppe committed May 3, 2017
1 parent 28c75e6 commit 11e470c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions system-container/root/exports/config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@
"mode=755"
]
},
{
"type": "bind",
"source": "$VAR_LOG_OPENSHIFT_LOG",
"destination": "/var/log/ansible.log",
"options": [
"bind",
"rw",
"mode=755"
]
},
{
"destination": "/root/.ansible",
"type": "tmpfs",
Expand Down
1 change: 1 addition & 0 deletions system-container/root/exports/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions system-container/root/exports/tmpfiles.template
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
d $VAR_LIB_OPENSHIFT_INSTALLER - - - - -
f $VAR_LOG_OPENSHIFT_LOG - - - - -
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh

export ANSIBLE_LOG_PATH=/var/log/ansible.log
exec ansible-playbook -i /etc/ansible/hosts ${OPTS} ${PLAYBOOK_FILE}

0 comments on commit 11e470c

Please sign in to comment.