Commit b9fd64e3 by Ned Batchelder

Make ansible unbuffered for better experience while logging

parent 6b74f621
......@@ -168,6 +168,12 @@ if [[ -f ${OPENEDX_ROOT}/app/edx_ansible/server-vars.yml ]]; then
SERVER_VARS="--extra-vars=\"@${OPENEDX_ROOT}/app/edx_ansible/server-vars.yml\""
fi
# When tee'ing to a log, ansible (like many programs) buffers its output. This
# makes it hard to tell what is actually happening during the upgrade.
# "stdbuf -oL" will run ansible with line-buffered stdout, which makes the
# messages scroll in the way people expect.
ANSIBLE_PLAYBOOK="sudo stdbuf -oL ansible-playbook --inventory-file=localhost, --connection=local "
make_config_venv () {
virtualenv venv
source venv/bin/activate
......@@ -209,9 +215,7 @@ EOF
echo "Upgrading to the end of Django 1.4"
cd configuration/playbooks/vagrant
sudo ansible-playbook \
--inventory-file=localhost, \
--connection=local \
$ANSIBLE_PLAYBOOK \
$SERVER_VARS \
--extra-vars="edx_platform_version=release-2015-11-09" \
--extra-vars="xqueue_version=named-release/cypress" \
......@@ -229,9 +233,7 @@ EOF
echo "Upgrading to the beginning of Django 1.8"
cd configuration/playbooks/vagrant
sudo ansible-playbook \
--inventory-file=localhost, \
--connection=local \
$ANSIBLE_PLAYBOOK \
$SERVER_VARS \
--extra-vars="edx_platform_version=dogwood-first-18" \
--extra-vars="xqueue_version=dogwood-first-18" \
......@@ -268,9 +270,7 @@ if [[ $TARGET == *eucalyptus* ]] ; then
echo "Upgrade the code"
cd configuration/playbooks/vagrant
sudo ansible-playbook \
--inventory-file=localhost, \
--connection=local \
$ANSIBLE_PLAYBOOK \
$SERVER_VARS \
--extra-vars="edx_platform_version=$TARGET" \
--extra-vars="xqueue_version=$TARGET" \
......@@ -296,9 +296,7 @@ echo "ora2_version: $TARGET" >> vars.yml
echo "certs_version: $TARGET" >> vars.yml
echo "forum_version: $TARGET" >> vars.yml
echo "xqueue_version: $TARGET" >> vars.yml
sudo ansible-playbook \
--inventory-file=localhost, \
--connection=local \
$ANSIBLE_PLAYBOOK \
--extra-vars="@vars.yml" \
$SERVER_VARS \
vagrant-$CONFIGURATION.yml
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment