From 8755db49ad09fb5721dd9423a495fb84b2bdacf6 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 14 May 2020 15:56:38 +0300 Subject: [PATCH 1/2] add condition to ansible --- images/linux/scripts/installers/ansible.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/images/linux/scripts/installers/ansible.sh b/images/linux/scripts/installers/ansible.sh index b7d2312a0..489001973 100644 --- a/images/linux/scripts/installers/ansible.sh +++ b/images/linux/scripts/installers/ansible.sh @@ -6,6 +6,13 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh +LSB_RELEASE=$(lsb_release -rs) + +# ppa:ansible/ansible doesn't contain packages for Ubuntu20.04 +if [ LSB_RELEASE != "20.04" ]; then + add-apt-repository ppa:ansible/ansible + apt-get update +fi # Install latest Ansible apt-get install -y --no-install-recommends ansible From 0b542230da7db0b6584431288389661ed439fefa Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 14 May 2020 17:04:55 +0300 Subject: [PATCH 2/2] use function in ansible --- images/linux/scripts/installers/ansible.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/ansible.sh b/images/linux/scripts/installers/ansible.sh index 489001973..b4a82a703 100644 --- a/images/linux/scripts/installers/ansible.sh +++ b/images/linux/scripts/installers/ansible.sh @@ -6,10 +6,12 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh -LSB_RELEASE=$(lsb_release -rs) +source $HELPER_SCRIPTS/os.sh + +imageLabel=$(getOSVersionLabel) # ppa:ansible/ansible doesn't contain packages for Ubuntu20.04 -if [ LSB_RELEASE != "20.04" ]; then +if [ $imageLabel != "focal" ]; then add-apt-repository ppa:ansible/ansible apt-get update fi