From a4c836c1b2e58a2d2372c4739e9496be6d6b790b Mon Sep 17 00:00:00 2001 From: Chris Smart Date: Sun, 24 Jul 2016 08:14:42 +1000 Subject: [PATCH] Fix override of ANSIBLE_PACKAGE variable The initialisation of the ANSIBLE_PACKAGE variable in bootstrap-ansible should be overridden by any existing environment variable of the same name, however it is incorrectly looking for "ANSIBLE_RELEASE." This means that any attempt to override the Ansible version will be ignored. This patch fixes it so that the script looks for a variable of the same name, "ANSIBLE_PACKAGE," and also updates the documentation. Related to commit: 88ae508e0f95 "Install Ansible from pypi instead of from a git clone." Change-Id: I5cf40ea855f05073fbe568cd9839dbd5134e19bf --- doc/source/developer-docs/scripts.rst | 15 ++++++++++++++- scripts/bootstrap-ansible.sh | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/source/developer-docs/scripts.rst b/doc/source/developer-docs/scripts.rst index 3dad43058c..7a43876f59 100644 --- a/doc/source/developer-docs/scripts.rst +++ b/doc/source/developer-docs/scripts.rst @@ -23,7 +23,20 @@ The ``bootstrap-ansible.sh`` script installs Ansible including `core`_ and While there are several configurable environment variables which this script uses, the following are commonly used: -* ``ANSIBLE_GIT_RELEASE`` - The version of Ansible to install. +* ``ANSIBLE_PACKAGE`` - The version of Ansible to install. + +For example: + +.. code:: bash + + $ export ANSIBLE_PACKAGE="ansible==2.1.0" + +Installing directly from git is also supported. For example, from the tip of +Ansible development branch: + +.. code:: bash + + $ export ANSIBLE_PACKAGE="git+https://github.com/ansible/ansible@devel#egg=ansible" * ``ANSIBLE_ROLE_FILE`` - The location of a yaml file which ansible-galaxy can consume which specifies which roles to download and install. The default diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index f41c175f9a..4e3cbef34d 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -22,7 +22,7 @@ set -e -u -x ## Vars ---------------------------------------------------------------------- export HTTP_PROXY=${HTTP_PROXY:-""} export HTTPS_PROXY=${HTTPS_PROXY:-""} -export ANSIBLE_PACKAGE=${ANSIBLE_RELEASE:-"ansible==2.1.0.0"} +export ANSIBLE_PACKAGE=${ANSIBLE_PACKAGE:-"ansible==2.1.0.0"} export ANSIBLE_ROLE_FILE=${ANSIBLE_ROLE_FILE:-"ansible-role-requirements.yml"} export SSH_DIR=${SSH_DIR:-"/root/.ssh"} export DEBIAN_FRONTEND=${DEBIAN_FRONTEND:-"noninteractive"}