aoh

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

commit bf584cd1a84b287d15704e68bbfe7b355d2ac165
parent 3f5a5857f50c3339478ee5c99de13b9fe4c389c5
Author: Asher Morgan <asher@ashermorgan.net>
Date:   Sun,  6 Sep 2026 08:02:38 -0700

Update demo playbook

Diffstat:
MREADME.md | 19++++++++++---------
Mdemo/playbooks.yml | 3++-
Ademo/playbooks/message.j2 | 8++++++++
Mdemo/playbooks/playbook.yml | 5++++-
4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/README.md b/README.md @@ -2,13 +2,13 @@ Run an Ansible playbook with a single `curl <url> | python` command. -More specifically, this command triggers an `ansible-playbook` run on the AoH -server, with the local client fetching execution instructions for its own tasks -over HTTP. This is especially useful for machines that are behind a NAT/firewall -(thus preventing the use of `ansible-playbook` directly), but also either run -Windows or aren't trusted with full repository access (thus preventing the use -of `ansible-pull`). For example, AoH can be used to easily install dotfiles on -new machines, anytime, anywhere. +More specifically, this triggers an `ansible-playbook` run on the AoH server, +with the local client fetching commands for its own tasks over HTTP. This is +especially useful for machines that are behind a NAT/firewall (thus preventing +the use of `ansible-playbook` directly), but also either run Windows or aren't +trusted with full repository access (thus preventing the use of `ansible-pull`). +For example, AoH can be used to easily install dotfiles on new machines, +anytime, anywhere. ## Comparison with Traditional Ansible & Ansible Pull @@ -34,7 +34,7 @@ the following commands: docker build -t aoh . docker run --rm --detach --name aoh -p 8000:8000 -v ./demo:/aoh aoh -# Run the client CLI (the AoH password is "hunter2") +# Run the client CLI (the demo AoH password is "hunter2") curl -s 127.0.0.1:8000/run | python3 curl -s 127.0.0.1:8000/run | python3 - --help @@ -118,7 +118,8 @@ main.yml: # The playbook name - '--list-tags' # Additional raw ansible-playbook options - extra_args: ['--limit', 'aoh'] # only run tasks for the current client + extra_args: + - '--diff' # Whether to allow clients to use Jinja expressions in ansible-playbook # options. Defaults to false. diff --git a/demo/playbooks.yml b/demo/playbooks.yml @@ -38,7 +38,8 @@ main.yml: # The playbook name - '--list-tags' # Additional raw ansible-playbook options - extra_args: ['--limit', 'aoh'] # only run tasks for the current client + extra_args: + - '--diff' # Whether to allow clients to use Jinja expressions in ansible-playbook # options. Defaults to false. diff --git a/demo/playbooks/message.j2 b/demo/playbooks/message.j2 @@ -0,0 +1,8 @@ +Welcome to AoH! + +The server is running this playbook with ansible-playbook, and your client is +fetching commands for its own tasks over HTTP. + +Username: {{ ansible_facts.user_id }} +Hostname: {{ ansible_facts.hostname }} +Timestamp: {{ now(utc=true,fmt='%Y-%m-%d %H:%M:%S') }} UTC diff --git a/demo/playbooks/playbook.yml b/demo/playbooks/playbook.yml @@ -1,4 +1,7 @@ - name: My play hosts: all tasks: - - ping: + - name: Write message to ~/aoh-demo.txt + ansible.builtin.template: + src: message.j2 + dest: ~/aoh-demo.txt