Compare commits

..

No commits in common. "14b484dd37465a65e3657284d19ebec78dd9b30a" and "edb616b61274bacd8a140c47f9f8400be064a632" have entirely different histories.

27 changed files with 79 additions and 68 deletions

View file

@ -1,8 +1,8 @@
domain: viyurz.fr domain: viyurz.fr
timezone: "Europe/Paris" timezone: "Europe/Paris"
host_uid: 1000 host_uid: 1000
project_dir: "{{ ansible_env['HOME'] }}/docker-projects/{{ role_name }}" docker_projects_dir: "{{ ansible_env['HOME'] }}/docker-projects"
docker_host: "unix:///run/user/{{ host_uid }}/docker.sock" project_dir: "{{ docker_projects_dir }}/{{ role_name }}"
# UID shift for mapping between host & containers # UID shift for mapping between host & containers
uid_shift: 99999 uid_shift: 99999

View file

@ -1,12 +1,12 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ coturn_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ coturn_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ coturn_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
@ -14,7 +14,7 @@
- name: Template turnserver.conf to project directory - name: Template turnserver.conf to project directory
template: template:
src: turnserver.conf src: turnserver.conf
dest: "{{ project_dir }}/turnserver.conf" dest: "{{ coturn_project_dir }}/turnserver.conf"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
mode: '640' mode: '640'
# Store result to restart services if the file changed # Store result to restart services if the file changed
@ -23,7 +23,7 @@
# Separate task because template module cannot chown/chgrp to a non-existing user/group # Separate task because template module cannot chown/chgrp to a non-existing user/group
- name: "Change group of turnserver.conf to coturn GID ({{ users['coturn'] + uid_shift }})" - name: "Change group of turnserver.conf to coturn GID ({{ users['coturn'] + uid_shift }})"
file: file:
path: "{{ project_dir }}/turnserver.conf" path: "{{ coturn_project_dir }}/turnserver.conf"
group: "{{ users['coturn'] + uid_shift }}" group: "{{ users['coturn'] + uid_shift }}"
become: true become: true
@ -62,7 +62,7 @@
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ coturn_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -76,6 +76,6 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ coturn_project_dir }}"
# Restart if config file(s) changed # Restart if config file(s) changed
restarted: "{{ coturn_template_turnserver_result['changed'] | bool }}" restarted: "{{ coturn_template_turnserver_result['changed'] | bool }}"

View file

@ -0,0 +1 @@
coturn_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -40,7 +40,7 @@
lineinfile: lineinfile:
path: "{{ ansible_env['HOME'] }}/.profile" path: "{{ ansible_env['HOME'] }}/.profile"
regex: '^export DOCKER_HOST=' regex: '^export DOCKER_HOST='
line: "export DOCKER_HOST={{ docker_host }}" line: "export DOCKER_HOST=unix:///run/user/{{ host_uid }}/docker.sock"
- name: "Make sure lingering is enabled for user {{ host_uid }}" - name: "Make sure lingering is enabled for user {{ host_uid }}"
command: command:

View file

@ -1,12 +1,12 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ element_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ element_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ element_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
@ -14,7 +14,7 @@
- name: Template config.json to project directory - name: Template config.json to project directory
template: template:
src: config.json src: config.json
dest: "{{ project_dir }}/config.json" dest: "{{ element_project_dir }}/config.json"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '644' mode: '644'
@ -22,7 +22,7 @@
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ element_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -36,6 +36,6 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ element_project_dir }}"
# Restart if config file(s) changed # Restart if config file(s) changed
restarted: "{{ element_template_config_result['changed'] | bool }}" restarted: "{{ element_template_config_result['changed'] | bool }}"

View file

@ -0,0 +1 @@
element_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -1,12 +1,12 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ etebase_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ etebase_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ etebase_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
@ -14,7 +14,7 @@
- name: Template etebase-server.ini to project directory - name: Template etebase-server.ini to project directory
template: template:
src: etebase-server.ini src: etebase-server.ini
dest: "{{ project_dir }}/etebase-server.ini" dest: "{{ etebase_project_dir }}/etebase-server.ini"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '644' mode: '644'
@ -30,7 +30,7 @@
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ etebase_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -50,4 +50,4 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ etebase_project_dir }}"

View file

@ -0,0 +1 @@
etebase_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -1,7 +1,7 @@
- name: Backup MySQL database - name: Backup MySQL database
community.docker.docker_container_exec: community.docker.docker_container_exec:
container: hedgedoc-mysql container: hedgedoc-mysql
docker_host: "{{ docker_host }}" docker_host: "unix:///run/user/{{ host_uid }}/docker.sock"
argv: argv:
- /bin/bash - /bin/bash
- "-c" - "-c"

View file

@ -1,12 +1,12 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ hedgedoc_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ hedgedoc_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ hedgedoc_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
@ -31,7 +31,7 @@
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ hedgedoc_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -51,4 +51,4 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ hedgedoc_project_dir }}"

View file

@ -0,0 +1 @@
hedgedoc_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -1,19 +1,19 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ homepage_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ homepage_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ homepage_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ homepage_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -27,4 +27,4 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ homepage_project_dir }}"

View file

@ -0,0 +1 @@
homepage_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -1,12 +1,12 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ mailserver_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ mailserver_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ mailserver_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
@ -55,7 +55,7 @@
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ mailserver_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -75,4 +75,4 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ mailserver_project_dir }}"

View file

@ -0,0 +1 @@
mailserver_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -8,7 +8,7 @@
- -
--stdin-name dumpall.sql --stdin-name dumpall.sql
environment: environment:
DOCKER_HOST: "{{ docker_host }}" DOCKER_HOST: "unix:///run/user/{{ host_uid }}/docker.sock"
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}" BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
become: true become: true

View file

@ -1,12 +1,12 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ searxng_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ searxng_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ searxng_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
@ -14,7 +14,7 @@
- name: Copy settings.yml and limiter.toml to project directory - name: Copy settings.yml and limiter.toml to project directory
copy: copy:
src: "{{ role_path }}/files/" src: "{{ role_path }}/files/"
dest: "{{ project_dir }}" dest: "{{ searxng_project_dir }}"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '644' mode: '644'
@ -23,7 +23,7 @@
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ searxng_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -37,6 +37,6 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ searxng_project_dir }}"
# Restart if config file(s) changed # Restart if config file(s) changed
restarted: "{{ searxng_copy_files_result['changed'] | bool }}" restarted: "{{ searxng_copy_files_result['changed'] | bool }}"

View file

@ -0,0 +1 @@
searxng_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -1,7 +1,7 @@
- name: Backup PostgreSQL database - name: Backup PostgreSQL database
community.docker.docker_container_exec: community.docker.docker_container_exec:
container: synapse-postgres container: synapse-postgres
docker_host: "{{ docker_host }}" docker_host: "unix:///run/user/{{ host_uid }}/docker.sock"
command: | command: |
pg_dump -c pg_dump -c
-d synapse -d synapse

View file

@ -1,12 +1,12 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ synapse_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ synapse_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ synapse_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
@ -14,7 +14,7 @@
- name: Template homeserver.yaml to project directory - name: Template homeserver.yaml to project directory
template: template:
src: homeserver.yaml src: homeserver.yaml
dest: "{{ project_dir }}/homeserver.yaml" dest: "{{ synapse_project_dir }}/homeserver.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
mode: '640' mode: '640'
# Store result to restart services if the file changed # Store result to restart services if the file changed
@ -23,7 +23,7 @@
# Separate task because template module cannot chown/chgrp to a non-existing user/group # Separate task because template module cannot chown/chgrp to a non-existing user/group
- name: "Change group of homeserver.yaml to synapse GID ({{ users['synapse'] + uid_shift }})" - name: "Change group of homeserver.yaml to synapse GID ({{ users['synapse'] + uid_shift }})"
file: file:
path: "{{ project_dir }}/homeserver.yaml" path: "{{ synapse_project_dir }}/homeserver.yaml"
group: "{{ users['synapse'] + uid_shift }}" group: "{{ users['synapse'] + uid_shift }}"
become: true become: true
@ -47,7 +47,7 @@
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ synapse_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -67,6 +67,6 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ synapse_project_dir }}"
# Restart if config file(s) changed # Restart if config file(s) changed
restarted: "{{ synapse_template_homeserver_result['changed'] | bool }}" restarted: "{{ synapse_template_homeserver_result['changed'] | bool }}"

View file

@ -0,0 +1 @@
synapse_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -1,19 +1,19 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ syncthing_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ syncthing_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ syncthing_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ syncthing_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -27,4 +27,4 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ syncthing_project_dir }}"

View file

@ -0,0 +1 @@
syncthing_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -1,12 +1,12 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ uptime_kuma_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ uptime_kuma_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml to project directory - name: Template docker-compose.yaml to project directory
template: template:
src: docker-compose.yaml src: docker-compose.yaml
dest: "{{ project_dir }}/docker-compose.yaml" dest: "{{ uptime_kuma_project_dir }}/docker-compose.yaml"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
@ -22,7 +22,7 @@
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ uptime_kuma_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -42,4 +42,4 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ uptime_kuma_project_dir }}"

View file

@ -0,0 +1 @@
uptime_kuma_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"

View file

@ -1,12 +1,12 @@
- name: "Create {{ project_dir }} project directory" - name: "Create {{ vaultwarden_project_dir }} project directory"
file: file:
path: "{{ project_dir }}" path: "{{ vaultwarden_project_dir }}"
state: directory state: directory
- name: Template docker-compose.yaml & .env to project directory - name: Template docker-compose.yaml & .env to project directory
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ project_dir }}/{{ item }}" dest: "{{ vaultwarden_project_dir }}/{{ item }}"
owner: "{{ host_uid }}" owner: "{{ host_uid }}"
group: "{{ host_uid }}" group: "{{ host_uid }}"
mode: '640' mode: '640'
@ -25,7 +25,7 @@
- name: Pull project services - name: Pull project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ vaultwarden_project_dir }}"
recreate: never recreate: never
pull: true pull: true
debug: true debug: true
@ -45,4 +45,4 @@
- name: Create/Restart project services - name: Create/Restart project services
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ project_dir }}" project_src: "{{ vaultwarden_project_dir }}"

View file

@ -0,0 +1 @@
vaultwarden_project_dir: "{{ docker_projects_dir }}/{{ role_name }}"