From c35c80b38c0b122084a9565da9f7ae41a36b600f Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Fri, 14 Aug 2020 10:44:14 -0400 Subject: [PATCH] Ensure sudo is installed as Ansible requirement Ansible requires sudo to be available and Docker images do not typically come with sudo pre-installed so add code to ensure it get's pulled in. Issue: RELENG-1052 Change-Id: I8e67f7048f2199f208c7596cb7b7c6182e61ed51 Signed-off-by: Thanh Ha --- provision/install-python.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/provision/install-python.sh b/provision/install-python.sh index 7ede4ec..102c87a 100755 --- a/provision/install-python.sh +++ b/provision/install-python.sh @@ -85,4 +85,13 @@ if is_centos8; then fi type python || type python3 + +# Ansible requires sudo so ensure it is available. +if ! command -v sudo; then + if command -v apt-get; then + apt-get install -y sudo + elif command -v yum; then + yum install -y sudo + fi +fi type sudo -- 2.16.6