ansible: playbook for postgres and gitea

This commit is contained in:
2024-07-18 10:36:12 +02:00
parent 0e2ea5cb36
commit f4b54d2941
25 changed files with 408 additions and 54 deletions
@@ -0,0 +1,13 @@
# to add/mount a partitiion, use the gparted utility to create it beforehand witht the matching name/label
hard_disk__partitions:
gitea_data:
- gitea
pg_data:
- postgres
hard_disk__applications:
postgres: "{{ postgres }}"
gitea: "{{ gitea }}"
hard_disk__postgres_databases:
gitea: "{{ gitea_database }}"
@@ -0,0 +1,43 @@
gitea_partition: |-
{{
hard_disk__partitions | dict2items | selectattr(
'value', 'contains', 'gitea'
) | map(attribute='key') | first
}}
gitea_database:
db_name: gitea
db_user: gitea
db_password: gitea
gitea:
partition: "{{ gitea_partition }}"
database:
dockercompose:
name: arcodange_factory
networks:
gitea:
name: arcodange_factory_gitea
external: true
services:
gitea:
image: gitea/gitea:1.22.1
container_name: gitea
restart: always
environment:
USER_UID: 1000
USER_GID: 1000
GITEA__database__DB_TYPE: postgres
GITEA__database__HOST: postgres:5432
GITEA__database__NAME: "{{ gitea_database.db_name }}"
GITEA__database__USER: "{{ gitea_database.db_user }}"
GITEA__database__PASSWD: "{{ gitea_database.db_password }}"
networks:
- gitea
ports:
- "80:3000"
- "2222:22"
volumes:
- /arcodange/{{gitea_partition}}/gitea/data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
@@ -0,0 +1,28 @@
postgres_partition: |-
{{
hard_disk__partitions | dict2items | selectattr(
'value', 'contains', 'postgres'
) | map(attribute='key') | first
}}
postgres:
partition: "{{ postgres_partition }}"
dockercompose:
name: arcodange_factory
networks:
gitea:
external: false
services:
postgres:
image: postgres:16.3-alpine
container_name: postgres
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
networks:
- gitea
ports:
- "5432"
volumes:
- /arcodange/{{postgres_partition}}/postgres/data:/var/lib/postgresql/data
@@ -34,4 +34,4 @@ gitea:
all:
children:
raspberry:
raspberries: