aoh

A tool for running Ansible playbooks with `curl <url> | python` commands
git clone https://git.ashermorgan.net/aoh/
Log | Files | Refs | README

commit 8cebcb161f22f232a0a5e261fe17ff29083e4f78
parent d5ff21ef4d41ba7524c751cca98b6586f019293d
Author: Asher Morgan <asher@ashermorgan.net>
Date:   Sun, 23 Aug 2026 13:43:21 -0700

Hide duplicate password prompts

Diffstat:
Maoh/client.py | 12+++++++++---
Maoh/runner.py | 2+-
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/aoh/client.py b/aoh/client.py @@ -14,9 +14,9 @@ from urllib.request import Request, urlopen API = '{{ API_URL }}' # Substitution performed by Flask PASSWORD_PROMPTS = { - 'vault_password': 'Vault password: ', - 'become_password': 'BECOME password: ', 'connection_password': 'SSH password: ', + 'become_password': 'BECOME password: ', + 'vault_password': 'Vault password: ', } @@ -104,7 +104,13 @@ def runner_loop(runner_url, cookies): assert status == 200 if 'logs' in res: - print(res['logs'], end='') + # Strip duplicate password prompts + logs = res['logs'] + while any(logs.startswith(prompt[:-2]) for prompt in + PASSWORD_PROMPTS.values()): + logs = logs.split('\n', 1)[1] + + print(logs, end='') req = {} if 'err' in res: diff --git a/aoh/runner.py b/aoh/runner.py @@ -13,7 +13,7 @@ _CONNECTION_PLUGIN_DIR = f'{os.path.dirname(__file__)}/connection_plugins/' _CLIENT_TIMEOUT = 600 # 10 minutes _PASSWORD_PROMPTS = { 'become_password': '^BECOME password.*:\\s*?$', - 'connect_password': '^SSH password:\\s*?$', + 'connection_password': '^SSH password:\\s*?$', 'vault_password': '^Vault password:\\s*?$', }