diff options
author | Markos Chandras <mchandras@suse.de> | 2017-10-24 17:24:10 +0200 |
---|---|---|
committer | Markos Chandras <mchandras@suse.de> | 2017-11-17 09:12:06 +0000 |
commit | 9024663d974680e769105045b1b7d4ea21f8d7fd (patch) | |
tree | bfe0e047c1bf20b6b25c86f81f30214391f559fc /xci | |
parent | ebcc3d3ca28e4412ba9c6c1340bd7c01e4328414 (diff) |
xci: file: install-ansible.sh: Update script from latest Bifrost
Update our own copy of the Ansible installation script to take some
Bifrost fixes into consideration. We also upgrade the pip and setuptools
to the latest available version if possible.
Change-Id: I5e51099b2698f0b03922d1364e83bc91cfadc00c
Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci')
-rw-r--r-- | xci/file/install-ansible.sh | 69 | ||||
-rwxr-xr-x | xci/xci-deploy.sh | 3 |
2 files changed, 44 insertions, 28 deletions
diff --git a/xci/file/install-ansible.sh b/xci/file/install-ansible.sh index 2661eea1..75ae1d82 100644 --- a/xci/file/install-ansible.sh +++ b/xci/file/install-ansible.sh @@ -7,34 +7,42 @@ set -eu declare -A PKG_MAP +# workaround: for latest bindep to work, it needs to use en_US local +export LANG=c + CHECK_CMD_PKGS=( + gcc libffi libopenssl + lsb-release + make net-tools python-devel + python + venv + wget ) source /etc/os-release || source /usr/lib/os-release - case ${ID,,} in *suse) OS_FAMILY="Suse" - INSTALLER_CMD="sudo -H -E zypper install -y" + INSTALLER_CMD="sudo -H -E zypper install -y --no-recommends" CHECK_CMD="zypper search --match-exact --installed" PKG_MAP=( [gcc]=gcc - [git]=git [libffi]=libffi-devel [libopenssl]=libopenssl-devel + [lsb-release]=lsb-release + [make]=make [net-tools]=net-tools [python]=python [python-devel]=python-devel [venv]=python-virtualenv [wget]=wget - [openssl]=openssl ) EXTRA_PKG_DEPS=( python-xml ) - sudo zypper -n ref + sudo zypper -n ref # NOTE (cinerama): we can't install python without removing this package # if it exists if $(${CHECK_CMD} patterns-openSUSE-minimal_base-conflicts &> /dev/null); then @@ -47,43 +55,45 @@ case ${ID,,} in export DEBIAN_FRONTEND=noninteractive INSTALLER_CMD="sudo -H -E apt-get -y install" CHECK_CMD="dpkg -l" - PKG_MAP=( [gcc]=gcc - [git]=git - [libffi]=libffi-dev - [libopenssl]=libssl-dev - [net-tools]=net-tools - [python]=python-minimal - [python-devel]=libpython-dev - [venv]=python-virtualenv - [wget]=wget - [openssl]=openssl - ) + PKG_MAP=( + [gcc]=gcc + [libffi]=libffi-dev + [libopenssl]=libssl-dev + [lsb-release]=lsb-release + [make]=make + [net-tools]=net-tools + [python]=python-minimal + [python-devel]=libpython-dev + [venv]=python-virtualenv + [wget]=wget + ) EXTRA_PKG_DEPS=() - sudo apt-get update + sudo apt-get update ;; - rhel|centos|fedora) + rhel|fedora|centos) OS_FAMILY="RedHat" PKG_MANAGER=$(which dnf || which yum) INSTALLER_CMD="sudo -H -E ${PKG_MANAGER} -y install" CHECK_CMD="rpm -q" PKG_MAP=( [gcc]=gcc - [git]=git [libffi]=libffi-devel [libopenssl]=openssl-devel + [lsb-release]=redhat-lsb + [make]=make [net-tools]=net-tools [python]=python [python-devel]=python-devel [venv]=python-virtualenv [wget]=wget - [openssl]=openssl ) sudo yum updateinfo EXTRA_PKG_DEPS=() - ;; + sudo yum update --assumeno + ;; - *) echo "ERROR: Supported package manager not found. Supported: apt,yum,zypper"; exit 1;; + *) echo "ERROR: Supported package manager not found. Supported: apt, dnf, yum, zypper"; exit 1;; esac if ! $(python --version &>/dev/null); then @@ -92,13 +102,14 @@ fi if ! $(gcc -v &>/dev/null); then ${INSTALLER_CMD} ${PKG_MAP[gcc]} fi -if ! $(git --version &>/dev/null); then - ${INSTALLER_CMD} ${PKG_MAP[git]} -fi if ! $(wget --version &>/dev/null); then ${INSTALLER_CMD} ${PKG_MAP[wget]} fi +if ! $(python -m virtualenv --version &>/dev/null); then + ${INSTALLER_CMD} ${PKG_MAP[venv]} +fi + for pkg in ${CHECK_CMD_PKGS[@]}; do if ! $(${CHECK_CMD} ${PKG_MAP[$pkg]} &>/dev/null); then ${INSTALLER_CMD} ${PKG_MAP[$pkg]} @@ -143,7 +154,9 @@ if ! which pip; then fi PIP=$(which pip) - -${PIP} install --user "pip>6.0" - +echo "Using pip: $(${PIP} --version)" +sudo -H -E ${PIP} install --upgrade virtualenv +sudo -H -E ${PIP} install --upgrade pip +# upgrade setuptools, as latest version is needed to install some projects +sudo -H -E ${PIP} install --upgrade setuptools ${PIP} install --user --upgrade ansible==$XCI_ANSIBLE_PIP_VERSION diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh index 7d29945a..92649857 100755 --- a/xci/xci-deploy.sh +++ b/xci/xci-deploy.sh @@ -91,7 +91,10 @@ echo "-------------------------------------------------------------------------" #------------------------------------------------------------------------------- # Install ansible on localhost #------------------------------------------------------------------------------- +echo "Info: Installing Ansible from pip" +echo "-------------------------------------------------------------------------" source file/install-ansible.sh +echo "-------------------------------------------------------------------------" # Make the VMs match the host. If we need to make this configurable # then this logic has to be moved outside this file |