Compare commits

..
4 Commits
Author SHA1 Message Date
mrcharles b9b4820051 fix(security): remove hardcoded AWX credential from script
The AWX admin password was hardcoded in scripts/awx_create_job_templates.py.
Read credentials from environment variables instead (AWX_USER,
AWX_PASSWORD, AWX_URL) and fail loudly when AWX_PASSWORD is unset.

No credentials are stored in this repository.

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

Assisted-by: GLM-5 via Crush <crush@charm.land>
2026-07-30 16:04:59 -05:00
mrcharles 77f6ac5d71 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 9343c05232 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 7fa2792256 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
+22 -8
View File
@@ -10,18 +10,32 @@ 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 = "http://100.91.39.53/api/v2" API = os.environ.get("AWX_URL", "http://100.91.39.53/api/v2")
AUTH = base64.b64encode(b"admin:Gransyan1!").decode() _AWX_USER = os.environ.get("AWX_USER", "admin")
PROJECT_ID = 10 _AWX_PASS = os.environ.get("AWX_PASSWORD")
INVENTORY_ID = 2 if not _AWX_PASS:
SCM_CRED_ID = 3 sys.exit("ERROR: AWX_PASSWORD environment variable is not set. "
MACHINE_CRED_ID = 4 "Refusing to run — no credentials are stored in this repo.")
ORG_ID = 1 AUTH = base64.b64encode(f"{_AWX_USER}:{_AWX_PASS}".encode()).decode()
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}"
@@ -144,7 +158,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: admin Login: $AWX_USER (password supplied via $AWX_PASSWORD env var)
Resources created: Resources created:
Credentials: Credentials: