2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-23 15:08:24 +00:00

fix(ansible): Make everything verbose

This commit is contained in:
Aditya Hase 2019-07-23 19:50:07 +05:30
parent bdda0419ea
commit 46566cd9ac
2 changed files with 2 additions and 5 deletions

View File

@ -814,7 +814,7 @@ def run_playbook(playbook_name, extra_vars=None, tag=None):
if not find_executable('ansible'): if not find_executable('ansible'):
print("Ansible is needed to run this command, please install it using 'pip install ansible'") print("Ansible is needed to run this command, please install it using 'pip install ansible'")
sys.exit(1) sys.exit(1)
args = ['ansible-playbook', '-c', 'local', playbook_name] args = ['ansible-playbook', '-c', 'local', playbook_name, '-vvvv']
if extra_vars: if extra_vars:
args.extend(['-e', json.dumps(extra_vars)]) args.extend(['-e', json.dumps(extra_vars)])

View File

@ -310,14 +310,11 @@ def get_extra_vars_json(extra_args):
return ('@' + json_path) return ('@' + json_path)
def run_playbook(playbook_name, sudo=False, extra_vars=None): def run_playbook(playbook_name, sudo=False, extra_vars=None):
args = ['ansible-playbook', '-c', 'local', playbook_name] args = ['ansible-playbook', '-c', 'local', playbook_name , '-vvvv']
if extra_vars: if extra_vars:
args.extend(['-e', get_extra_vars_json(extra_vars)]) args.extend(['-e', get_extra_vars_json(extra_vars)])
if extra_vars.get('verbosity'):
args.append('-vvvv')
if sudo: if sudo:
user = extra_vars.get('user') or getpass.getuser() user = extra_vars.get('user') or getpass.getuser()
args.extend(['--become', '--become-user={0}'.format(user)]) args.extend(['--become', '--become-user={0}'.format(user)])