Ensure sudo is installed as Ansible requirement 94/65094/1
authorThanh Ha <zxiiro@gmail.com>
Fri, 14 Aug 2020 14:44:14 +0000 (10:44 -0400)
committerThanh Ha <zxiiro@gmail.com>
Fri, 14 Aug 2020 14:52:28 +0000 (10:52 -0400)
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 <zxiiro@gmail.com>
provision/install-python.sh

index 7ede4ec..102c87a 100755 (executable)
@@ -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