diff --git a/pottwal.yml b/pottwal.yml index bc784fc..375725c 100644 --- a/pottwal.yml +++ b/pottwal.yml @@ -19,6 +19,11 @@ hedgedoc_host_port: 8084 hedgedoc_image: quay.io/hedgedoc/hedgedoc:1.9.3 + redmine_host_port: 8087 + redmine_image: redmine:4.2.7 + redmine_mysql_image: mysql:5.7 + redmine_database: redmine + roles: - role: docker_setup vars: @@ -38,6 +43,7 @@ alternate_names: - conference.jabber.n39.eu deploy_cert_hook: "docker exec prosody prosodyctl --root cert import ${DOMAIN} /var/lib/dehydrated/certs" + - name: redmine.n39.eu - role: penguineer.dehydrated_cron - role: dd24-dyndns-cron # variables are set in the inventory @@ -253,4 +259,68 @@ proxy_port: "{{ hedgedoc_host_port }}" + # Expected setup for the data directory + # file: configuration.yml + # directory: mysql + # directory: files + # directory: themes + - name: Check if redmine data dir exists + ansible.builtin.stat: + path: "{{ data_dir }}/redmine" + register: redmine_dir + - name: Fail if redmine data dir does not exist + ansible.builtin.fail: + msg: "Redmine data dir is missing, please restore from the backup!" + when: not redmine_dir.stat.exists + + - name: Setup Redmine docker network + docker_network: + name: redminenet + state: present + internal: true + + - name: Setup Redmine MySQL container + docker_container: + name: redminedb + image: "{{ redmine_mysql_image }}" + pull: true + state: started + restart_policy: unless-stopped + detach: yes + env: + MYSQL_ROOT_PASSWORD: "{{ redmine_database_password }}" + MYSQL_DATABASE: "{{redmine_database }}" + volumes: + - "{{ data_dir }}/redmine/mysql:/var/lib/mysql" + networks: + - name: redminenet + + - name: Setup Redmine container + docker_container: + name: redmine + image: "{{ redmine_image }}" + pull: true + state: started + restart_policy: unless-stopped + detach: yes + ports: + - "127.0.0.1:{{ redmine_host_port }}:3000" + env: + REDMINE_DB_MYSQL: redminedb + REDMINE_DB_PASSWORD: "{{ redmine_database_password }}" + volumes: + - "{{ data_dir }}/redmine/configuration.yml:/usr/src/redmine/config/configuration.yml" + - "{{ data_dir }}/redmine/files:/usr/src/redmine/files" + - "{{ data_dir }}/redmine/themes:/usr/src/redmine/public/themes" + networks: + - name: redminenet + + - name: Setup proxy site redmine.n39.eu + include_role: + name: setup-http-site-proxy + vars: + site_name: redmine.n39.eu + proxy_port: "{{ redmine_host_port }}" + + handlers: