feat: add mastodon support directly
This commit is contained in:
47
roles/mastodon/tasks/mastodon.yml
Normal file
47
roles/mastodon/tasks/mastodon.yml
Normal 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
|
Reference in New Issue
Block a user