Deploy mastodon v0.1

This commit is contained in:
2026-02-03 10:52:11 +02:00
commit 43395ee775
34 changed files with 794 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
---
- name: Populate database variables
ansible.builtin.include_vars:
file: db.yml
- name: Create DB instance for mastodon
containers.podman.podman_container:
name: database
image: docker.io/library/postgres:17
network:
- "{{ mastodon_networks['mastodon_internal']['name'] }}"
env:
POSTGRES_DB: mastodon
POSTGRES_USER: "{{ mastodon_database.username }}"
POSTGRES_PASSWORD: "{{ mastodon_database.password }}"
volumes:
- "/home/apps/mastodon/postgresql:/var/lib/postgresql/data:Z"
generate_systemd:
new: true
restart_policy: "always"
path: "~/.config/systemd/user/"
force: true
healthcheck: "pg_isready -U postgres"
- name: Activate database container service
ansible.builtin.systemd_service:
name: container-database.service
state: started
enabled: true
scope: user