From 3c59aaaae0690cae5660a3f2949cf4b4f4574dcb Mon Sep 17 00:00:00 2001 From: Masanori Itoh Date: Sun, 9 Feb 2020 03:15:44 +0000 Subject: [PATCH] fix(ansible): fix wrong ansible version installation issue under Bionic --- ansible/install_ansible.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ansible/install_ansible.sh b/ansible/install_ansible.sh index 6f56e1108..68689dbdd 100755 --- a/ansible/install_ansible.sh +++ b/ansible/install_ansible.sh @@ -68,7 +68,12 @@ fi echo Installing ansible ${REQUIRED_ANSIBLE_VER} required for ceph-ansible ${CEPH_ANSIBLE_BRANCH} branch. sudo add-apt-repository -y ppa:ansible/ansible-${REQUIRED_ANSIBLE_VER} sudo apt-get update -sudo apt-get install -y ansible +if [ "${REQUIRED_ANSIBLE_VER}" == "2.4" ]; then + PKG_VER=`apt-cache showpkg ansible | sed '/^Provides:/,/^Reverse Provides:/{//!b};d' | egrep ^2\\.4 | sort -r | head -1 | awk '{print $1;}'` + sudo apt-get install -y ansible=${PKG_VER} +else + sudo apt-get install -y ansible +fi sleep 3 sudo add-apt-repository -y -r ppa:ansible/ansible-${REQUIRED_ANSIBLE_VER}