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 ...@@ -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\"" SERVER_VARS="--extra-vars=\"@${OPENEDX_ROOT}/app/edx_ansible/server-vars.yml\""
fi 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 () { make_config_venv () {
virtualenv venv virtualenv venv
source venv/bin/activate source venv/bin/activate
...@@ -220,9 +226,7 @@ EOF ...@@ -220,9 +226,7 @@ EOF
echo "Upgrading to the end of Django 1.4" echo "Upgrading to the end of Django 1.4"
cd configuration/playbooks/vagrant cd configuration/playbooks/vagrant
sudo ansible-playbook \ $ANSIBLE_PLAYBOOK \
--inventory-file=localhost, \
--connection=local \
$SERVER_VARS \ $SERVER_VARS \
--extra-vars="edx_platform_version=release-2015-11-09" \ --extra-vars="edx_platform_version=release-2015-11-09" \
--extra-vars="xqueue_version=named-release/cypress" \ --extra-vars="xqueue_version=named-release/cypress" \
...@@ -240,9 +244,7 @@ EOF ...@@ -240,9 +244,7 @@ EOF
echo "Upgrading to the beginning of Django 1.8" echo "Upgrading to the beginning of Django 1.8"
cd configuration/playbooks/vagrant cd configuration/playbooks/vagrant
sudo ansible-playbook \ $ANSIBLE_PLAYBOOK \
--inventory-file=localhost, \
--connection=local \
$SERVER_VARS \ $SERVER_VARS \
--extra-vars="edx_platform_version=dogwood-first-18" \ --extra-vars="edx_platform_version=dogwood-first-18" \
--extra-vars="xqueue_version=dogwood-first-18" \ --extra-vars="xqueue_version=dogwood-first-18" \
...@@ -292,9 +294,7 @@ if [[ $TARGET == *eucalyptus* ]] ; then ...@@ -292,9 +294,7 @@ if [[ $TARGET == *eucalyptus* ]] ; then
echo "Upgrade the code" echo "Upgrade the code"
cd configuration/playbooks/vagrant cd configuration/playbooks/vagrant
sudo ansible-playbook \ $ANSIBLE_PLAYBOOK \
--inventory-file=localhost, \
--connection=local \
$SERVER_VARS \ $SERVER_VARS \
--extra-vars="edx_platform_version=$TARGET" \ --extra-vars="edx_platform_version=$TARGET" \
--extra-vars="xqueue_version=$TARGET" \ --extra-vars="xqueue_version=$TARGET" \
...@@ -320,9 +320,7 @@ echo "ora2_version: $TARGET" >> vars.yml ...@@ -320,9 +320,7 @@ echo "ora2_version: $TARGET" >> vars.yml
echo "certs_version: $TARGET" >> vars.yml echo "certs_version: $TARGET" >> vars.yml
echo "forum_version: $TARGET" >> vars.yml echo "forum_version: $TARGET" >> vars.yml
echo "xqueue_version: $TARGET" >> vars.yml echo "xqueue_version: $TARGET" >> vars.yml
sudo ansible-playbook \ $ANSIBLE_PLAYBOOK \
--inventory-file=localhost, \
--connection=local \
--extra-vars="@vars.yml" \ --extra-vars="@vars.yml" \
$SERVER_VARS \ $SERVER_VARS \
vagrant-$CONFIGURATION.yml 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