Includes: API (Express/TypeScript), Astro site, Python workers, document generators, FCC compliance tools, Canada CRTC formation, Ansible infrastructure, and deployment scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
68 lines
2 KiB
YAML
68 lines
2 KiB
YAML
---
|
|
# Performance West — ERPNext role
|
|
# Uses frappe/erpnext:version-15 with MariaDB 10.6 (officially supported stack).
|
|
|
|
- name: Ensure ERPNext containers are running
|
|
community.docker.docker_compose_v2:
|
|
project_src: "{{ project_dir }}"
|
|
services:
|
|
- erpnext
|
|
- erpnext-worker-default
|
|
- erpnext-worker-short
|
|
- erpnext-scheduler
|
|
- erpnext-mariadb
|
|
- erpnext-redis
|
|
state: present
|
|
register: erpnext_compose
|
|
|
|
- name: Wait for MariaDB to accept connections
|
|
ansible.builtin.command:
|
|
cmd: >-
|
|
docker compose exec -T erpnext-mariadb
|
|
mysqladmin ping -u root -p{{ erpnext_db_password }} --silent
|
|
chdir: "{{ project_dir }}"
|
|
register: mariadb_ready
|
|
retries: 20
|
|
delay: 5
|
|
until: mariadb_ready.rc == 0
|
|
changed_when: false
|
|
|
|
- name: Wait for ERPNext gunicorn to be ready
|
|
ansible.builtin.uri:
|
|
url: "http://localhost:{{ erpnext_port }}"
|
|
return_content: false
|
|
status_code: [200, 302, 307, 308]
|
|
register: erpnext_health
|
|
retries: 30
|
|
delay: 10
|
|
until: erpnext_health.status in [200, 302, 307, 308]
|
|
|
|
- name: Initialize ERPNext site (first run only)
|
|
ansible.builtin.command:
|
|
cmd: >-
|
|
docker compose exec -T erpnext
|
|
bench new-site {{ domain }}
|
|
--db-host erpnext-mariadb
|
|
--db-port 3306
|
|
--db-name erpnext
|
|
--db-root-username root
|
|
--db-root-password {{ erpnext_db_password }}
|
|
--db-password {{ erpnext_db_password }}
|
|
--admin-password {{ vault_erpnext_admin_password }}
|
|
--install-app erpnext
|
|
chdir: "{{ project_dir }}"
|
|
creates: "{{ project_dir }}/erpnext-initialized"
|
|
register: erpnext_init
|
|
|
|
- name: Set ERPNext site as default
|
|
ansible.builtin.command:
|
|
cmd: docker compose exec -T erpnext bench use {{ domain }}
|
|
chdir: "{{ project_dir }}"
|
|
when: erpnext_init.changed
|
|
changed_when: true
|
|
|
|
- name: Mark ERPNext as initialized
|
|
ansible.builtin.file:
|
|
path: "{{ project_dir }}/erpnext-initialized"
|
|
state: touch
|
|
when: erpnext_init.changed
|