From: Thanh Ha Date: Fri, 14 Aug 2020 14:44:14 +0000 (-0400) Subject: Ensure sudo is installed as Ansible requirement X-Git-Tag: v0.7.0~3 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=c35c80b38c0b122084a9565da9f7ae41a36b600f;p=releng%2Fcommon-packer.git 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 --- 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