feat: add mastodon support directly

This commit is contained in:
VC
2024-07-05 11:53:29 +02:00
parent a8868f7f07
commit e77ff577c1
17 changed files with 427 additions and 12 deletions

View File

@@ -0,0 +1,47 @@
---
- name: git mastodon
remote_user: mastodon
git:
repo: "https://github.com/mastodon/mastodon.git"
dest: "{{ mastodon_home }}/live"
version: "v{{ mastodon_version }}"
- name: bundle config command
remote_user: mastodon
shell: |
bash -lic "bundle config deployment 'true' && bundle config without 'development test'"
args:
creates: "{{ mastodon_home }}/.bundle/config"
chdir: "{{ mastodon_home }}/live"
- name: bundle install
remote_user: mastodon
shell: |
bash -lic "bundle install -j$(getconf _NPROCESSORS_ONLN)"
args:
chdir: "{{ mastodon_home }}/live"
- name: yarn install
remote_user: mastodon
shell: |
bash -lic "yarn install --pure-lockfile"
args:
chdir: "{{ mastodon_home }}/live"
- name: install services
template:
src: "{{ item }}.j2"
dest: "/etc/systemd/system/{{ item }}"
loop: &mastodon_services
- "mastodon-sidekiq.service"
- "mastodon-streaming.service"
- "mastodon-web.service"
- name: run services
systemd:
name: "{{ item }}"
daemon_reload: true
state: started
enabled: true
loop: *mastodon_services