Merge pull request 'Move Redmine to pottwal' (!90) from redmine into master

Reviewed-on: https://gitea.n39.eu/Netz39_Admin/netz39-infra-ansible/pulls/90
Reviewed-by: dkdent <dkdent@netz39.de>
This commit is contained in:
Stefan Haun 2022-10-20 20:40:28 +00:00
commit 457c795efb
3 changed files with 78 additions and 0 deletions

View file

@ -19,6 +19,7 @@
- server: pottwal - server: pottwal
hosts: hosts:
- name: gitea.n39.eu - name: gitea.n39.eu
- name: redmine.n39.eu
- name: uritools.n39.eu - name: uritools.n39.eu
- name: uritools-api.n39.eu - name: uritools-api.n39.eu
- name: sl.n39.eu - name: sl.n39.eu

View file

@ -95,6 +95,13 @@ all:
38656238663565386631306263333166633064313762343139373735626439666665356530383363 38656238663565386631306263333166633064313762343139373735626439666665356530383363
3134373261386435310a626461376537643937643838636638313033383463356663396464643361 3134373261386435310a626461376537643937643838636638313033383463356663396464643361
36333766383139376331336633646633396430323663366636616431643134666536 36333766383139376331336633646633396430323663366636616431643134666536
redmine_database_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
31343936363663616665346336616366313761363866353533646464393163363161306331323639
3030643563363731646365643362626664633130656265330a623566333734343562393432636336
32366339366433626466306634383563343633343736393735336130363462346265646431393839
3566326231663663340a383731353935366234643132386438663736313938356266613432303232
3165
unicorn.n39.eu: unicorn.n39.eu:
server_admin: "admin+unicorn@netz39.de" server_admin: "admin+unicorn@netz39.de"
platon.n39.eu: platon.n39.eu:

View file

@ -19,6 +19,11 @@
hedgedoc_host_port: 8084 hedgedoc_host_port: 8084
hedgedoc_image: quay.io/hedgedoc/hedgedoc:1.9.3 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: roles:
- role: docker_setup - role: docker_setup
vars: vars:
@ -38,6 +43,7 @@
alternate_names: alternate_names:
- conference.jabber.n39.eu - conference.jabber.n39.eu
deploy_cert_hook: "docker exec prosody prosodyctl --root cert import ${DOMAIN} /var/lib/dehydrated/certs" deploy_cert_hook: "docker exec prosody prosodyctl --root cert import ${DOMAIN} /var/lib/dehydrated/certs"
- name: redmine.n39.eu
- role: penguineer.dehydrated_cron - role: penguineer.dehydrated_cron
- role: dd24-dyndns-cron - role: dd24-dyndns-cron
# variables are set in the inventory # variables are set in the inventory
@ -253,4 +259,68 @@
proxy_port: "{{ hedgedoc_host_port }}" 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: handlers: