Add mastodon-systemd role.
This commit is contained in:
parent
e3090a4395
commit
68d0032b44
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=mastodon-sidekiq
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=mastodon
|
||||||
|
WorkingDirectory=/home/mastodon/live
|
||||||
|
Environment="RAILS_ENV=production"
|
||||||
|
Environment="DB_POOL=5"
|
||||||
|
ExecStart=/home/mastodon/.rbenv/shims/bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push
|
||||||
|
TimeoutSec=15
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=mastodon-streaming
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=mastodon
|
||||||
|
WorkingDirectory=/home/mastodon/live
|
||||||
|
Environment="NODE_ENV=production"
|
||||||
|
Environment="PORT=4000"
|
||||||
|
ExecStart=/usr/bin/npm run start
|
||||||
|
TimeoutSec=15
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -0,0 +1,17 @@
|
||||||
|
[Unit]
|
||||||
|
Description=mastodon-web
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=mastodon
|
||||||
|
WorkingDirectory=/home/mastodon/live
|
||||||
|
Environment="RAILS_ENV=production"
|
||||||
|
Environment="PORT=3000"
|
||||||
|
ExecStart=/home/mastodon/.rbenv/shims/bundle exec puma -C config/puma.rb
|
||||||
|
ExecReload=/bin/kill -SIGUSR1 $MAINPID
|
||||||
|
TimeoutSec=15
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
# This role copies over various Mastodon service files and enables them
|
||||||
|
|
||||||
|
- name: Copy Mastodon systemd service files
|
||||||
|
copy: src={{ item }} dest=/etc/systemd/system/{{ item }} backup=yes
|
||||||
|
with_items:
|
||||||
|
- mastodon-sidekiq.service
|
||||||
|
- mastodon-streaming.service
|
||||||
|
- mastodon-web.service
|
||||||
|
- name: Enable Mastodon systemd services
|
||||||
|
systemd: name={{ item }} enabled=yes
|
||||||
|
with_items:
|
||||||
|
- mastodon-sidekiq
|
||||||
|
- mastodon-streaming
|
||||||
|
- mastodon-web
|
Loading…
Reference in New Issue