Compare commits

..
3 Commits
Author SHA1 Message Date
mrcharles 95d6d6a6f7 chore: ignore local validation venv
Add .venv/ to .gitignore so the locally-bootstrapped Ansible tooling
(ansible-core, ansible-lint, yamllint) used for pre-push validation is
never accidentally committed.

🤖 Generated with [Crush](https://github.com/charmassociates/crush)

Assisted-by: GLM-5 via Crush <crush@charm.land>
2026-07-30 16:00:30 -05:00
mrcharles 281d580298 docs: update README with full documentation
Add legacy-to-Ansible mapping table, host-class conditionals reference,
AWX setup instructions, and configuration variable reference.

🤖 Generated with [Crush](https://github.com/charmassociates/crush)

Assisted-by: GLM-5 via Crush <crush@charm.land>
2026-07-30 12:16:48 -05:00
mrcharles a5962007c3 feat(awx): add AWX job template creation script
Add scripts/awx_create_job_templates.py that creates the two AWX job
templates (Hello World + Setup New System) after the code has been
pushed to git and the project has synced. Run this once after cloning
the repo on a new AWX instance.

🤖 Generated with [Crush](https://github.com/charmassociates/crush)

Assisted-by: GLM-5 via Crush <crush@charm.land>
2026-07-30 12:16:44 -05:00
+8 -22
View File
@@ -10,32 +10,18 @@ It will:
4. Create the inventory source (auto-syncs hosts from inventory/hosts.yml) 4. Create the inventory source (auto-syncs hosts from inventory/hosts.yml)
Usage: Usage:
export AWX_PASSWORD='...'
python3 awx_create_job_templates.py python3 awx_create_job_templates.py
Configuration (environment variables):
AWX_URL AWX API base URL (default: http://100.91.39.53/api/v2)
AWX_USER AWX admin username (default: admin)
AWX_PASSWORD AWX admin password (REQUIRED - never committed to the repo)
AWX_PROJECT_ID, AWX_INVENTORY_ID, AWX_SCM_CRED_ID,
AWX_MACHINE_CRED_ID, AWX_ORG_ID resource IDs (sensible defaults below)
""" """
import os
import urllib.request, urllib.parse, json, base64, time, sys import urllib.request, urllib.parse, json, base64, time, sys
API = os.environ.get("AWX_URL", "http://100.91.39.53/api/v2") API = "http://100.91.39.53/api/v2"
_AWX_USER = os.environ.get("AWX_USER", "admin") AUTH = base64.b64encode(b"admin:Gransyan1!").decode()
_AWX_PASS = os.environ.get("AWX_PASSWORD") PROJECT_ID = 10
if not _AWX_PASS: INVENTORY_ID = 2
sys.exit("ERROR: AWX_PASSWORD environment variable is not set. " SCM_CRED_ID = 3
"Refusing to run — no credentials are stored in this repo.") MACHINE_CRED_ID = 4
AUTH = base64.b64encode(f"{_AWX_USER}:{_AWX_PASS}".encode()).decode() ORG_ID = 1
PROJECT_ID = int(os.environ.get("AWX_PROJECT_ID", "10"))
INVENTORY_ID = int(os.environ.get("AWX_INVENTORY_ID", "2"))
SCM_CRED_ID = int(os.environ.get("AWX_SCM_CRED_ID", "3"))
MACHINE_CRED_ID = int(os.environ.get("AWX_MACHINE_CRED_ID", "4"))
ORG_ID = int(os.environ.get("AWX_ORG_ID", "1"))
def awx_req(method, endpoint, data=None): def awx_req(method, endpoint, data=None):
url = f"{API}/{endpoint}" url = f"{API}/{endpoint}"
@@ -158,7 +144,7 @@ print("ALL DONE - AWX is ready!")
print("=" * 60) print("=" * 60)
print(""" print("""
AWX URL: http://tsys-awx.knel.net (or http://100.91.39.53) AWX URL: http://tsys-awx.knel.net (or http://100.91.39.53)
Login: $AWX_USER (password supplied via $AWX_PASSWORD env var) Login: admin
Resources created: Resources created:
Credentials: Credentials: