From 4558daaf51614c742b80f62cd3f04ad6149e94ac Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Thu, 2 Feb 2017 16:39:46 +0300 Subject: [PATCH] Install python-pip, ensure other admin node packages Now ensures sshpass and git on admin node Change-Id: I28802cda3b66c2d8a0949b63575f89591160edc5 --- utils/jenkins/kargo_deploy.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/jenkins/kargo_deploy.sh b/utils/jenkins/kargo_deploy.sh index 669af97..f53b475 100755 --- a/utils/jenkins/kargo_deploy.sh +++ b/utils/jenkins/kargo_deploy.sh @@ -225,6 +225,14 @@ admin_node_command mkdir -p $ADMIN_WORKSPACE/utils/kargo tar cz ${BASH_SOURCE%/*}/../kargo | admin_node_command tar xzf - -C $ADMIN_WORKSPACE/utils/ echo "Setting up ansible and required dependencies..." +# Install mandatory packages on admin node +if ! admin_node_command type sshpass 2>&1 > /dev/null; then + admin_node_command "sh -c \"sudo apt-get update && sudo apt-get install -y sshpass\"" +fi +if ! admin_node_command type git 2>&1 > /dev/null; then + admin_node_command "sh -c \"sudo apt-get update && sudo apt-get install -y git\"" +fi + if ! admin_node_command type ansible 2>&1 > /dev/null; then # Wait for apt lock in case it is updating from cron job case $ADMIN_NODE_BASE_OS in @@ -252,9 +260,9 @@ if ! admin_node_command type ansible 2>&1 > /dev/null; then esac wait_for_apt_lock_release if [[ "$ANSIBLE_INSTALL_SOURCE" == "apt" ]]; then - with_retries admin_node_command -- sudo apt-get install -y ansible python-netaddr git + with_retries admin_node_command -- sudo apt-get install -y ansible python-netaddr elif [[ "$ANSIBLE_INSTALL_SOURCE" == "pip" ]]; then - with_retries admin_node_command -- sudo apt-get install -y python-netaddr git libssl-dev + with_retries admin_node_command -- sudo apt-get install -y python-netaddr libssl-dev python-pip with_retries admin_node_command -- sudo pip install --upgrade ansible==$required_ansible_version else echo "ERROR: Unknown Ansible install source: ${ANSIBLE_INSTALL_SOURCE}"