From 5d9996b727fcd86cfe4c1c709595c2922d6d9078 Mon Sep 17 00:00:00 2001 From: Jonathan DeMasi Date: Sun, 28 Dec 2025 14:32:10 -0700 Subject: [PATCH] Init ansible runner --- misc/ansible-runner.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 misc/ansible-runner.sh diff --git a/misc/ansible-runner.sh b/misc/ansible-runner.sh new file mode 100644 index 0000000..1eaa016 --- /dev/null +++ b/misc/ansible-runner.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Set pwd, don't expect to use +cd /home/ansible + +# Ensure we have a log dir +mkdir -p /home/ansible/logs + +# Cleanup +rm -rf /home/ansible/infra +rm -rf /home/ansible/venv + +# Clone the infra repo +git clone git@git.jthan.io:jonathan/infra /home/ansible/infra + +# Create a venv +python3 -m venv /home/ansible/venv + +# Source venv +. /home/ansible/venv/bin/activate + +# Install requirements for ansible +pip install -r /home/ansible/infra/ansible/requirements.txt + +# Change into ansible subdir of repo +cd /home/ansible/infra/ansible + +# Run updates +ansible-playbook site.yaml >> /home/ansible/logs/runner.log