diff --git a/roles/web-app-xwiki/config/main.yml b/roles/web-app-xwiki/config/main.yml index db49cdeb..e5f66a1f 100644 --- a/roles/web-app-xwiki/config/main.yml +++ b/roles/web-app-xwiki/config/main.yml @@ -5,9 +5,10 @@ docker: enabled: false database: enabled: true + type: postgres xwiki: image: xwiki - version: stable-mariadb-tomcat + version: lts-<< defaults_applications[web-app-xwiki].docker.services.database.type >>-tomcat name: xwiki backup: no_stop_required: true diff --git a/roles/web-app-xwiki/tasks/01_core.yml b/roles/web-app-xwiki/tasks/01_core.yml index b85ddf71..33caa3ea 100644 --- a/roles/web-app-xwiki/tasks/01_core.yml +++ b/roles/web-app-xwiki/tasks/01_core.yml @@ -16,12 +16,6 @@ dest: "{{ XWIKI_HOST_PROPERTIES_PATH }}" notify: docker compose up -- name: "Render hibernate.cfg.xml" - template: - src: "hibernate.cfg.xml.j2" - dest: "{{ XWIKI_HOST_HIBERNATE_PATH }}" - notify: docker compose up - - name: "flush docker compose for '{{ application_id }}'" meta: flush_handlers diff --git a/roles/web-app-xwiki/templates/docker-compose.yml.j2 b/roles/web-app-xwiki/templates/docker-compose.yml.j2 index 13469737..f069f242 100644 --- a/roles/web-app-xwiki/templates/docker-compose.yml.j2 +++ b/roles/web-app-xwiki/templates/docker-compose.yml.j2 @@ -11,8 +11,6 @@ volumes: - "{{ XWIKI_HOST_CONF_PATH }}:/usr/local/xwiki/xwiki.cfg" - "{{ XWIKI_HOST_PROPERTIES_PATH }}:/usr/local/xwiki/xwiki.properties" - - "{{ XWIKI_HOST_HIBERNATE_PATH }}:/usr/local/xwiki/hibernate.cfg.xml" - - "{{ XWIKI_HOST_HIBERNATE_PATH }}:/usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml" - 'data:/usr/local/xwiki' {% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %} diff --git a/roles/web-app-xwiki/templates/env.j2 b/roles/web-app-xwiki/templates/env.j2 index d43be81a..087141a4 100644 --- a/roles/web-app-xwiki/templates/env.j2 +++ b/roles/web-app-xwiki/templates/env.j2 @@ -3,3 +3,4 @@ DB_PASSWORD="{{ database_password }}" DB_HOST="{{ database_host }}" DB_PORT="{{ database_port }}" DB_DATABASE="{{ database_name }}" +DB_TYPE="{{ 'mariadb' if database_type == 'mariadb' else 'postgresql' }}" diff --git a/roles/web-app-xwiki/templates/hibernate.cfg.xml.j2 b/roles/web-app-xwiki/templates/hibernate.cfg.xml.j2 deleted file mode 100644 index b38b18b6..00000000 --- a/roles/web-app-xwiki/templates/hibernate.cfg.xml.j2 +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - org.mariadb.jdbc.Driver - jdbc:mariadb://{{ database_host }}:{{ database_port }}/{{ database_name }}?useUnicode=true&characterEncoding=UTF-8 - {{ database_username }} - {{ database_password }} - - - true - true - SELECT 1 - 5 - 30000 - 60000 - - diff --git a/roles/web-app-xwiki/vars/main.yml b/roles/web-app-xwiki/vars/main.yml index a3768575..4439e772 100644 --- a/roles/web-app-xwiki/vars/main.yml +++ b/roles/web-app-xwiki/vars/main.yml @@ -1,6 +1,7 @@ # General application_id: "web-app-xwiki" -database_type: "mariadb" +database_type: "{{ applications | get_app_conf(application_id, 'docker.services.database.type') }}" + container_port: 8080 container_hostname: "{{ domains | get_domain(application_id) }}" @@ -14,7 +15,6 @@ XWIKI_HOSTNAME: "{{ container_hostname }}" ## Paths XWIKI_HOST_CONF_PATH: "{{ [docker_compose.directories.config, 'xwiki.cfg'] | path_join }}" XWIKI_HOST_PROPERTIES_PATH: "{{ [docker_compose.directories.config, 'xwiki.properties'] | path_join }}" -XWIKI_HOST_HIBERNATE_PATH: "{{ [docker_compose.directories.config, 'hibernate.cfg.xml'] | path_join }}" ## Docker XWIKI_IMAGE_CUSTOM: "xwiki_custom" diff --git a/roles/web-svc-cdn/tasks/01_core.yml b/roles/web-svc-cdn/tasks/01_core.yml index 84850b14..171f3acb 100644 --- a/roles/web-svc-cdn/tasks/01_core.yml +++ b/roles/web-svc-cdn/tasks/01_core.yml @@ -15,4 +15,6 @@ template: src: "nginx.conf.j2" dest: "{{ CDN_NGINX_PATH }}" - notify: restart openresty \ No newline at end of file + notify: restart openresty + +- include_tasks: utils/run_once.yml \ No newline at end of file diff --git a/roles/web-svc-cdn/tasks/main.yml b/roles/web-svc-cdn/tasks/main.yml index 8d10e412..935414d4 100644 --- a/roles/web-svc-cdn/tasks/main.yml +++ b/roles/web-svc-cdn/tasks/main.yml @@ -1,6 +1,5 @@ - block: - include_tasks: 01_core.yml - - include_tasks: utils/run_once.yml when: run_once_web_svc_cdn is not defined - include_tasks: "{{ playbook_dir }}/tasks/utils/load_handlers.yml"