fix(Makefile, playbook.yml): ensure Ansible syntax-check has access to group_vars and clean up playbook formatting

- Add all group_vars/all/*.yml as extra-vars (-e @file) in Makefile syntax-check
- Use consistent quoting in playbook.yml for SOFTWARE_NAME and host_type templating

Ref: https://chatgpt.com/share/68cdee8a-4e88-800f-bf62-bed66dbbb417
This commit is contained in:
2025-09-20 02:00:25 +02:00
parent c424afa935
commit 79db2419a6
2 changed files with 4 additions and 4 deletions

View File

@@ -73,7 +73,7 @@ messy-test:
@echo "🧪 Running Python tests…" @echo "🧪 Running Python tests…"
PYTHONPATH=. python -m unittest discover -s tests PYTHONPATH=. python -m unittest discover -s tests
@echo "📑 Checking Ansible syntax…" @echo "📑 Checking Ansible syntax…"
ansible-playbook playbook.yml --syntax-check ansible-playbook -i localhost, -c local $(foreach f,$(wildcard group_vars/all/*.yml),-e @$(f)) playbook.yml --syntax-check
install: build install: build
@echo "⚙️ Install complete." @echo "⚙️ Install complete."

View File

@@ -1,10 +1,10 @@
- name: Execute {{ SOFTWARE_NAME }} Play - name: "Execute {{ SOFTWARE_NAME }} Play"
hosts: all hosts: all
tasks: tasks:
- name: "Load 'constructor' tasks" - name: "Load 'constructor' tasks"
include_tasks: "tasks/stages/01_constructor.yml" include_tasks: "tasks/stages/01_constructor.yml"
- name: "Load '{{host_type}}' tasks" - name: "Load '{{ host_type }}' tasks"
include_tasks: "tasks/stages/02_{{host_type}}.yml" include_tasks: "tasks/stages/02_{{ host_type }}.yml"
- name: "Load 'destructor' tasks" - name: "Load 'destructor' tasks"
include_tasks: "tasks/stages/03_destructor.yml" include_tasks: "tasks/stages/03_destructor.yml"
become: true become: true