Created role docker-compose and refactored attendize, akauntin, openproject

This commit is contained in:
2023-12-30 15:22:18 +01:00
parent 3181ce3def
commit f70a7690a8
18 changed files with 122 additions and 146 deletions

View File

@@ -1,8 +0,0 @@
---
- name: recreate openproject
command:
cmd: docker-compose -p openproject up -d --force-recreate
chdir: "{{ docker_compose_instance_directory }}"
environment:
COMPOSE_HTTP_TIMEOUT: 600
DOCKER_CLIENT_TIMEOUT: 600

View File

@@ -1,2 +1,2 @@
dependencies:
- nginx-docker-reverse-proxy
- docker-compose

View File

@@ -2,54 +2,11 @@
- name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml
- name: "backup docker-compose.yml if it exists"
command: >
mv "{{ docker_compose_file_path }}" "{{ docker_compose_backup_path }}"
args:
removes: "{{ docker_compose_file_path }}"
become: true
- name: register directory
stat:
path: "{{docker_compose_instance_directory}}"
register: docker_compose_instance_directory_register
- name: checkout repository
ansible.builtin.shell: git checkout .
become: true
args:
chdir: "{{docker_compose_instance_directory}}"
when: docker_compose_instance_directory_register.stat.exists
- name: pull docker repository
git:
repo: "https://github.com/opf/openproject-deploy"
dest: "{{ repository_directory }}"
update: yes
notify: recreate openproject
become: true
register: git_result
- name: "restore docker-compose.yml from backup"
command: >
mv "{{ docker_compose_backup_path }}" "{{ docker_compose_file_path }}"
args:
removes: "{{ docker_compose_backup_path }}"
become: true
- name: Warn if repo is not reachable
debug:
msg: "Warning: Repository is not reachable."
when: git_result.failed
- name: "include tasks update-repository-with-docker-compose.yml"
include_tasks: update-repository-with-docker-compose.yml
- name: "copy .env"
template:
src: env.j2
dest: "{{ docker_compose_instance_directory }}.env"
notify: recreate openproject
- name: "copy docker-compose.yml"
template:
src: docker-compose.yml.j2
dest: "{{ docker_compose_file_path }}"
notify: recreate openproject
notify: docker compose project setup

View File

@@ -21,7 +21,7 @@ x-op-app: &app
RAILS_CACHE_STORE: "memcache"
OPENPROJECT_CACHE__MEMCACHE__SERVER: "cache:11211"
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
DATABASE_URL: "${DATABASE_URL:-postgres://postgres:p4ssw0rd@db/openproject?pool=20&encoding=unicode&reconnect=true}"
DATABASE_URL: "${DATABASE_URL}"
RAILS_MIN_THREADS: ${RAILS_MIN_THREADS:-4}
RAILS_MAX_THREADS: ${RAILS_MAX_THREADS:-16}
# set to true to enable the email receiving feature. See ./docker/cron for more options
@@ -31,7 +31,7 @@ x-op-app: &app
- "${PGDATA}:/var/openproject/pgdata"
services:
db:
database:
image: postgres:13
<<: *restart_policy
stop_grace_period: "3s"
@@ -72,7 +72,7 @@ services:
- frontend
- backend
depends_on:
- db
- database
- cache
- seeder
labels:
@@ -99,7 +99,7 @@ services:
networks:
- backend
depends_on:
- db
- database
- cache
- seeder
@@ -109,7 +109,7 @@ services:
networks:
- backend
depends_on:
- db
- database
- cache
- seeder

View File

@@ -1,9 +1,11 @@
repository_directory: "{{ path_docker_compose_instances }}openproject/"
docker_compose_instance_directory: "{{repository_directory}}compose/"
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
docker_compose_backup_path: "/tmp/openproject-docker-compose-backup.yml"
database_instance: "openproject"
database_host: "db"
database_databasename: "{{database_instance}}"
database_username: "postgres"
database_password: "{{openproject_database_password}}"
docker_compose_project_name: "openproject"
repository_directory: "{{ path_docker_compose_instances }}{{docker_compose_project_name}}/"
docker_compose_instance_directory: "{{repository_directory}}compose/"
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose-backup.yml"
database_instance: "{{docker_compose_project_name}}"
database_host: "database"
database_databasename: "{{database_instance}}"
database_username: "postgres"
database_password: "{{openproject_database_password}}"
repository_address: "https://github.com/opf/openproject-deploy"