From 639d9a58b3b48d899ca31de1c209b56b99bbab0f Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Tue, 21 Jul 2020 14:49:49 +0200 Subject: [PATCH] Make ansible ask for sudo password If the user used to install and run bifrost can't run sudo passwordless, the bifrost-cli appends the --ask-become-pass option that makes ansible ask for the BECOME password, used to run commands with become set to true. Change-Id: I7148243b19baa8bfdd652827a9280d469622e3f3 --- bifrost/cli.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bifrost/cli.py b/bifrost/cli.py index 7816888cf..bc4d93d12 100644 --- a/bifrost/cli.py +++ b/bifrost/cli.py @@ -231,8 +231,7 @@ def check_for_root(): '[ $(whoami) == root ] || sudo --non-interactive true', shell=True, stderr=subprocess.DEVNULL) except subprocess.CalledProcessError: - # TODO(dtantsur): tell ansible to ask for password - sys.exit('Sudo without password is required for Bifrost') + COMMON_PARAMS.append('--ask-become-pass') def main():