aoh

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

commit cff275d906977393de1680ffa5a6288f0778683e
parent e857a23dcf4348f84ef53ed7fadfb1bacfdf8622
Author: Asher Morgan <asher@ashermorgan.net>
Date:   Sun, 16 Aug 2026 16:48:16 -0700

Auto set API_URL in install.py

Diffstat:
Maoh/install.py | 2+-
Maoh/server.py | 6+++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/aoh/install.py b/aoh/install.py @@ -6,7 +6,7 @@ import time import requests # TODO: eliminate dependency? -API = 'http://localhost:5000' +API = '{{ API_URL }}' # Substitution performed by Flask def exec(args): diff --git a/aoh/server.py b/aoh/server.py @@ -1,13 +1,13 @@ import os -from flask import Flask, abort, make_response, request, send_file, session +from flask import Flask, abort, make_response, render_template, request, session from .runner import AoHRunner PLAYBOOK = os.path.abspath('./demo/playbook.yml') # TODO CONFIG = os.path.abspath('./demo/ansible.cfg') # TODO -app = Flask(__name__) +app = Flask(__name__, template_folder=os.path.dirname(__file__)) app.secret_key = os.urandom(16) _DATA = {} @@ -16,7 +16,7 @@ _DATA = {} @app.get('/install') @app.get('/install.py') def install(): - return send_file('install.py') + return render_template('install.py', API_URL=request.host_url[:-1]) @app.post('/runners/')