All checks were successful
CI / skip-ci-check (pull_request) Successful in 1m22s
CI / lint-and-test (pull_request) Successful in 1m27s
CI / ansible-validation (pull_request) Successful in 2m53s
CI / secret-scanning (pull_request) Successful in 1m24s
CI / dependency-scan (pull_request) Successful in 1m28s
CI / sast-scan (pull_request) Successful in 2m32s
CI / license-check (pull_request) Successful in 1m28s
CI / vault-check (pull_request) Successful in 2m30s
CI / playbook-test (pull_request) Successful in 2m32s
CI / container-scan (pull_request) Successful in 1m53s
CI / sonar-analysis (pull_request) Successful in 2m40s
CI / workflow-summary (pull_request) Successful in 1m22s
- Fix deploy script to handle non-git directories by cloning to temp location and moving contents, preserving .env files during clone - Remove comment lines from env.j2 template to prevent xargs errors - Add initial deploy task to app_setup role to ensure app is deployed before service starts - Fix migrate command precedence to check env-specific overrides first - Add sudo to systemctl restart commands in deploy script - Update documentation with project-specific configuration notes These changes improve deployment reliability for all app projects while adding support for mirrormatch-specific requirements (db:push, seeding). All changes are backward-compatible with existing projects (pote, punimTag).
42 lines
1.4 KiB
YAML
42 lines
1.4 KiB
YAML
---
|
|
# Playbook: app/provision_vms.yml
|
|
# Purpose: Provision Proxmox guests for app projects (LXC-first) based on `app_projects`.
|
|
# Targets: localhost (Proxmox API)
|
|
# Tags: app, provision
|
|
#
|
|
# Usage:
|
|
# - Run one project: ansible-playbook -i inventories/production playbooks/app/provision_vms.yml -e app_project=projectA
|
|
# - Run all projects: ansible-playbook -i inventories/production playbooks/app/provision_vms.yml
|
|
|
|
- name: Provision Proxmox guests for app projects
|
|
hosts: localhost
|
|
connection: local
|
|
gather_facts: false
|
|
tags: ['app', 'provision']
|
|
vars:
|
|
selected_projects: >-
|
|
{{
|
|
(app_projects | dict2items | map(attribute='key') | list)
|
|
if (app_project is not defined or app_project | length == 0)
|
|
else [app_project]
|
|
}}
|
|
selected_envs: >-
|
|
{{
|
|
[app_env]
|
|
if (app_env is defined and app_env | length > 0)
|
|
else ['dev', 'qa', 'prod']
|
|
}}
|
|
|
|
tasks:
|
|
- name: Validate requested project exists
|
|
ansible.builtin.assert:
|
|
that:
|
|
- app_project is not defined or app_project in app_projects
|
|
fail_msg: "Requested app_project={{ app_project }} does not exist in app_projects."
|
|
|
|
- name: Provision each project/env guest via Proxmox API
|
|
ansible.builtin.include_tasks: provision_one_guest.yml
|
|
loop: "{{ selected_projects }}"
|
|
loop_control:
|
|
loop_var: project_key
|