aoh

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

commit 1102ebc98a5e059cb430295a2b62050c70e52b81
parent c174b962cda5e205a4d597489e2c3bf442811f78
Author: Asher Morgan <asher@ashermorgan.net>
Date:   Wed,  2 Sep 2026 18:42:29 -0700

Implement AOH_DEBUG option

Diffstat:
MREADME.md | 5++++-
Maoh/runner.py | 6+++++-
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md @@ -1,4 +1,4 @@ -# Ansible-over-HTTP (AoH) +# AoH: Ansible-over-HTTP Run an Ansible playbook with a single `curl <url> | python` command. @@ -50,6 +50,9 @@ docker stop aoh AoH supports the following configuration options, specified either via environment variables or a `.env` file. +- `AOH_DEBUG`: If set to `1`, the AoH server will copy Ansible logs to stdout. + Defaults to `0`. + - `AOH_ORIGIN`: The origin of the AoH server, as referenced in the `/run.py` script (e.g. `https://aoh.example.com:5000`). This must be set if running AoH behind a proxy. Defaults to the origin on which requests for `/run.py` are diff --git a/aoh/runner.py b/aoh/runner.py @@ -9,8 +9,12 @@ from uuid import uuid4 import ansible_runner +_AOH_DEBUG = (os.getenv('AOH_DEBUG', '0') == '1') + _CONNECTION_PLUGIN_DIR = f'{os.path.dirname(__file__)}/connection_plugins/' + _CLIENT_TIMEOUT = 600 # 10 minutes. TODO: update based on aoh timeout? + _PASSWORD_PROMPTS = { 'become_password': '^BECOME password.*:\\s*?$', 'connection_password': '^SSH password:\\s*?$', @@ -118,7 +122,7 @@ class Runner: cmdline=cmdline, passwords=pw_prompt_answers, playbook=self.playbook.path, - quiet=True, + quiet=not _AOH_DEBUG, suppress_env_files=True, )