Add option to have two services in one role and add phpvms_test

This commit is contained in:
Tobias Reisinger 2026-02-09 23:20:17 +01:00
parent 8065273196
commit 4a71c9c170
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
8 changed files with 33 additions and 16 deletions

View file

@ -9,20 +9,20 @@ phpvms_gid: 1000
phpvms_app_key: "{{ undef() }}"
phpvms_domain: "kondor-virtual.de"
phpvms_svc:
domain: "kondor-virtual.de"
domain: "{{ phpvms_domain }}"
port: 80
phpvms_env:
WWWUSER: "{{ phpvms_uid }}"
WWWGROUP: "{{ phpvms_gid }}"
CADDY_DOMAIN: "http://{{ svc.domain }}"
APP_KEY: "{{ phpvms_app_key | mandatory }}"
APP_NAME: phpVMS
SITE_NAME: phpVMS
APP_URL: "https://{{ svc.domain }}"
APP_URL: "https://{{ phpvms_domain }}"
APP_LOCALE: de
APP_ENV: production
@ -143,12 +143,8 @@ phpvms_compose:
default:
mariadb:
container_name: phpvms-mariadb
image: mariadb:11
restart: always
# If someone need to access db from the outside
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: '${DB_DATABASE}'
@ -167,7 +163,6 @@ phpvms_compose:
retries: 3
redis:
container_name: phpvms-redis
image: redis:alpine
restart: always
networks:

View file

@ -0,0 +1 @@
vmsacars.tar.gz

View file

@ -33,12 +33,14 @@
group: "{{ phpvms_gid }}"
become: true
notify: Restart service {{ service_name }}
when: service_name == role_name # Only use on "main" instance
- name: Copy Caddyfile
ansible.builtin.copy:
src: Caddyfile
- name: Template Caddyfile
ansible.builtin.template:
src: Caddyfile.j2
dest: "{{ (service_path, 'Caddyfile') | path_join }}"
mode: "0644"
notify: Restart service {{ service_name }}
- name: Import start tasks for common service
ansible.builtin.import_tasks: tasks/start-common-service.yml

View file

@ -1,4 +1,4 @@
{$CADDY_DOMAIN} {
http://{{ phpvms_domain }} {
root * /var/www/html/public
encode zstd gzip

View file

@ -0,0 +1,2 @@
service_name_overwrite: phpvms_test # noqa: var-naming[no-role-prefix]
phpvms_domain: "test.kondor-virtual.de"