Move static files into files/ and Jinja2 templates into templates/ #169

Merged
samsapti merged 7 commits from move_stuff_around into main 2023-09-29 21:09:08 +00:00
4 changed files with 55 additions and 32 deletions
Showing only changes of commit f9946e72ca - Show all commits

View file

@ -80,7 +80,7 @@ services:
file: gitea.yml file: gitea.yml
domain: "git.{{ base_domain }}" domain: "git.{{ base_domain }}"
volume_folder: "{{ volume_root_folder }}/gitea" volume_folder: "{{ volume_root_folder }}/gitea"
version: 1.18 version: "1.20"
allowed_sender_domain: true allowed_sender_domain: true
passit: passit:
@ -110,7 +110,7 @@ services:
file: privatebin.yml file: privatebin.yml
domain: "paste.{{ base_domain }}" domain: "paste.{{ base_domain }}"
volume_folder: "{{ volume_root_folder }}/privatebin" volume_folder: "{{ volume_root_folder }}/privatebin"
version: 20221009 version: "20221009"
codimd: codimd:
file: codimd.yml file: codimd.yml
@ -174,11 +174,11 @@ services:
file: drone.yml file: drone.yml
domain: "drone.{{ base_domain }}" domain: "drone.{{ base_domain }}"
volume_folder: "{{ volume_root_folder }}/drone" volume_folder: "{{ volume_root_folder }}/drone"
version: 1 version: "1"
mailu: mailu:
file: mailu.yml file: mailu.yml
version: 1.9 version: "1.9"
domain: "mail.{{ base_domain }}" domain: "mail.{{ base_domain }}"
dns: 192.168.203.254 dns: 192.168.203.254
subnet: 192.168.203.0/24 subnet: 192.168.203.0/24
@ -218,4 +218,4 @@ services:
watchtower: watchtower:
file: watchtower.yml file: watchtower.yml
version: amd64-1.5.3 version: "1.5.3"

View file

@ -1,18 +1,33 @@
# vim: ft=yaml.ansible # vim: ft=yaml.ansible
--- ---
- name: create mastodon volume folders - name: Create volume folder for Mastodon data
file: file:
name: "{{ services.mastodon.volume_folder }}/{{ volume }}" name: "{{ services.mastodon.volume_folder }}/mastodon_data"
state: directory state: directory
owner: "991" owner: "991"
group: "991" mode: u=rwx,g=rx,o=rx
loop:
- "postgres_data" - name: Create volume folder for PostgreSQL data
- "postgres_config" file:
- "redis_data" name: "{{ services.mastodon.volume_folder }}/postgres_data"
- "mastodon_data" state: directory
loop_control: owner: "70"
loop_var: volume mode: u=rwx,go=
- name: Create volume folder for PostgreSQL config
file:
name: "{{ services.mastodon.volume_folder }}/postgres_config"
state: directory
owner: root
mode: u=rwx,g=rx,o=rx
- name: Create volume folder for Redis data
valberg marked this conversation as resolved Outdated

can we call this file mastodon ?

can we call this file mastodon ?
file:
name: "{{ services.mastodon.volume_folder }}/redis_data"
state: directory
owner: "999"
group: "1000"
mode: u=rwx,g=rx,o=rx
- name: Copy mastodon environment file - name: Copy mastodon environment file
template: template:
@ -187,3 +202,21 @@
external: true external: true
internal_network: internal_network:
internal: true internal: true
- name: Configure cron job to remove old Mastodon media daily
cron:
name: Clean Mastodon media data older than a week
cron_file: ansible_mastodon_clean_media
job: docker exec mastodon_web_1 tootctl media remove --days 7
special_time: daily
user: root
state: present
- name: Configure cron job to remove old Mastodon preview cards daily
cron:
name: Clean Mastodon preview card data older than two weeks
cron_file: ansible_mastodon_clean_preview_cards
job: docker exec mastodon_web_1 tootctl preview_cards remove --days 14
special_time: daily
user: root
state: present

View file

@ -82,6 +82,7 @@
networks: networks:
- matrix - matrix
- external_services - external_services
- postfix
volumes: volumes:
- "{{ services.matrix.volume_folder }}/data:/data" - "{{ services.matrix.volume_folder }}/data:/data"
environment: environment:
@ -113,5 +114,7 @@
external_services: external_services:
external: external:
name: external_services name: external_services
postfix:
external: true
matrix: matrix:
name: "matrix" name: "matrix"

View file

@ -820,23 +820,10 @@ password_config:
# If your SMTP server requires authentication, the optional smtp_user & # If your SMTP server requires authentication, the optional smtp_user &
# smtp_pass variables should be used # smtp_pass variables should be used
# #
#email: email:
# enable_notifs: false smtp_host: "{{ smtp_host }}"
# smtp_host: "localhost" smtp_port: {{ smtp_port }}
# smtp_port: 25 notif_from: "{{ services.matrix.domain }} <no-reply@{{ services.matrix.domain }}>"
# smtp_user: "exampleusername"
# smtp_pass: "examplepassword"
# require_transport_security: False
# notif_from: "Your Friendly %(app)s Home Server <noreply@example.com>"
# app_name: Matrix
# # if template_dir is unset, uses the example templates that are part of
# # the Synapse distribution.
# #template_dir: res/templates
# notif_template_html: notif_mail.html
# notif_template_text: notif_mail.txt
# notif_for_new_users: True
# riot_base_url: "http://localhost/riot"
#password_providers: #password_providers:
# - module: "ldap_auth_provider.LdapAuthProvider" # - module: "ldap_auth_provider.LdapAuthProvider"