summaryrefslogtreecommitdiffstats
path: root/xci
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-11-20 09:51:25 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-11-20 09:51:25 +0000
commit0234db9d76656d8f28ba3ee11367e08703ccd769 (patch)
tree94b0aefd1e9b4bd1d8d2457cb445bd7fc1f698c1 /xci
parent54afc4c3a060793d68b362584a7ab0788ff53617 (diff)
parent9024663d974680e769105045b1b7d4ea21f8d7fd (diff)
Merge "xci: file: install-ansible.sh: Update script from latest Bifrost"
Diffstat (limited to 'xci')
-rw-r--r--xci/file/install-ansible.sh69
-rwxr-xr-xxci/xci-deploy.sh3
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