Commit b3a96bf2 by Ned Batchelder Committed by GitHub

Merge pull request #3316 from edx/ned/unbuffered-ansible

Make ansible unbuffered for better experience while logging
parents 667ad1f5 b9fd64e3
......@@ -179,6 +179,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
......@@ -220,9 +226,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" \
......@@ -240,9 +244,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" \
......@@ -292,9 +294,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" \
......@@ -320,9 +320,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