From 6c402ce9bd2967b33ed9892d29d379258c204fac Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 6 Nov 2026 18:35:47 +0000 Subject: [PATCH] refactor(ansible): relocate Proxmox VM provisioning playbook --- ansible/proxmox/{semaphore_vm => }/README.md | 10 +++++----- ansible/{ => proxmox}/provision_vm.yml | 0 ansible/proxmox/{semaphore_vm => }/requirements.txt | 0 ansible/proxmox/{semaphore_vm => }/requirements.yml | 0 ansible/proxmox/{semaphore_vm => }/tests/test_flow.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename ansible/proxmox/{semaphore_vm => }/README.md (86%) rename ansible/{ => proxmox}/provision_vm.yml (100%) rename ansible/proxmox/{semaphore_vm => }/requirements.txt (100%) rename ansible/proxmox/{semaphore_vm => }/requirements.yml (100%) rename ansible/proxmox/{semaphore_vm => }/tests/test_flow.py (99%) diff --git a/ansible/proxmox/semaphore_vm/README.md b/ansible/proxmox/README.md similarity index 86% rename from ansible/proxmox/semaphore_vm/README.md rename to ansible/proxmox/README.md index 4aaf0e9..e5824fa 100644 --- a/ansible/proxmox/semaphore_vm/README.md +++ b/ansible/proxmox/README.md @@ -1,14 +1,14 @@ # Semaphore single Proxmox VM -`ansible/provision_vm.yml` clones one existing cloud-init-ready QEMU template, configures CPU, RAM, network, cloud-init user/key and disk while stopped, then starts it. This is one-shot provisioning, not reconciliation; no Terraform state, SSH, guest readiness check, or automatic deletion. +`ansible/proxmox/provision_vm.yml` clones one existing cloud-init-ready QEMU template, configures CPU, RAM, network, cloud-init user/key and disk while stopped, then starts it. This is one-shot provisioning, not reconciliation; no Terraform state, SSH, guest readiness check, or automatic deletion. ## Runner and fixed configuration -Create an Ansible task template in Semaphore pointing to `ansible/provision_vm.yml` and a localhost inventory (`localhost ansible_connection=local`). The runner needs API reachability and a supported Python environment. Install Ansible Core, Python dependencies and the pinned real collection in that environment: +Create an Ansible task template in Semaphore pointing to `ansible/proxmox/provision_vm.yml` and a localhost inventory (`localhost ansible_connection=local`). The runner needs API reachability and a supported Python environment. Install Ansible Core, Python dependencies and the pinned real collection in that environment: ```sh -python3 -m pip install ansible-core -r ansible/proxmox/semaphore_vm/requirements.txt -ansible-galaxy collection install -r ansible/proxmox/semaphore_vm/requirements.yml +python3 -m pip install ansible-core -r ansible/proxmox/requirements.txt +ansible-galaxy collection install -r ansible/proxmox/requirements.yml ``` Assign a Semaphore Variable Group to the template. Put `proxmox_api_token_id` (full `user@realm!token` identifier) and `proxmox_api_token_secret` in the group's **Secrets** tab. The playbook splits the full token identifier into the module's `api_user=user@realm` and `api_token_id=token`. Do not expose these as survey inputs or commit them. Restrict token permissions and template launch access. API tasks use `no_log`; avoid verbose secret logging. TLS verification is enabled; trust the Proxmox CA in the runner. Never disable TLS verification. @@ -51,7 +51,7 @@ Non-secret example survey JSON: For manual invocation, store fixed and survey non-secret variables in local JSON files outside this public repository and token variables in an encrypted Ansible Vault file outside it. Do not place credentials on the command line: ```sh -ansible-playbook -i localhost, -c local ansible/provision_vm.yml \ +ansible-playbook -i localhost, -c local ansible/proxmox/provision_vm.yml \ -e @/path/to/fixed-config.json -e @/path/to/survey.json \ -e @/path/to/encrypted-token.yml --ask-vault-pass ``` diff --git a/ansible/provision_vm.yml b/ansible/proxmox/provision_vm.yml similarity index 100% rename from ansible/provision_vm.yml rename to ansible/proxmox/provision_vm.yml diff --git a/ansible/proxmox/semaphore_vm/requirements.txt b/ansible/proxmox/requirements.txt similarity index 100% rename from ansible/proxmox/semaphore_vm/requirements.txt rename to ansible/proxmox/requirements.txt diff --git a/ansible/proxmox/semaphore_vm/requirements.yml b/ansible/proxmox/requirements.yml similarity index 100% rename from ansible/proxmox/semaphore_vm/requirements.yml rename to ansible/proxmox/requirements.yml diff --git a/ansible/proxmox/semaphore_vm/tests/test_flow.py b/ansible/proxmox/tests/test_flow.py similarity index 99% rename from ansible/proxmox/semaphore_vm/tests/test_flow.py rename to ansible/proxmox/tests/test_flow.py index a0e08e2..bb53b47 100644 --- a/ansible/proxmox/semaphore_vm/tests/test_flow.py +++ b/ansible/proxmox/tests/test_flow.py @@ -9,7 +9,7 @@ from proxmoxer.backends.https import ProxmoxHTTPApiTokenAuth from requests import Request ROOT = Path(__file__).resolve().parents[1] -PLAYBOOK = ROOT.parents[1] / "provision_vm.yml" +PLAYBOOK = ROOT / "provision_vm.yml" COLLECTION = "community/proxmox/plugins/modules" MOCK = '''#!/usr/bin/python import json