[Unit] | |||||
Description=A privacy aware distributed social network | |||||
{%- if diaspora.install_redis %} | |||||
Wants={{ diaspora.redis_service }}.service | |||||
{%- endif %} | |||||
[Service] | |||||
User={{ diaspora.user.username }} | |||||
Environment=RAILS_ENV={{ diaspora.configuration.server.rails_environment }} | |||||
WorkingDirectory={{ diaspora.install_path }} | |||||
ExecStart=/bin/bash -lc "script/server" | |||||
Restart=on-failure | |||||
[Install] | |||||
WantedBy=multi-user.target |
include: | include: | ||||
- diaspora.install | - diaspora.install | ||||
- diaspora.config | - diaspora.config | ||||
# - diaspora.service | |||||
- diaspora.service |
redis_package: | redis_package: | ||||
pkg.installed: | pkg.installed: | ||||
- name: {{ diaspora.redis_package }} | - name: {{ diaspora.redis_package }} | ||||
redis_service: | |||||
service.running: | |||||
- name: {{ diaspora.redis_service }} | |||||
{%- endif %} | {%- endif %} | ||||
diaspora_user: | diaspora_user: | ||||
- env: | - env: | ||||
- RAILS_ENV: {{ diaspora.environment }} | - RAILS_ENV: {{ diaspora.environment }} | ||||
- require: | - require: | ||||
- cmd: diaspora_bundle_install | |||||
- file: {{ diaspora.install_path }}/config/database.yml | - file: {{ diaspora.install_path }}/config/database.yml | ||||
- file: {{ diaspora.install_path }}/config/diaspora.yml | - file: {{ diaspora.install_path }}/config/diaspora.yml | ||||
- onchanges: | - onchanges: |
{%- from "diaspora/map.jinja" import diaspora with context %} | |||||
include: | |||||
- diaspora.install | |||||
- diaspora.config | |||||
/etc/systemd/system/diaspora.service: | |||||
file.managed: | |||||
- user: root | |||||
- mode: 644 | |||||
- source: salt://diaspora/files/diaspora.service | |||||
- template: jinja | |||||
- context: | |||||
diaspora: {{ diaspora|json }} | |||||
diaspora_service: | |||||
service.running: | |||||
- name: diaspora | |||||
- enable: True | |||||
- requre: | |||||
- cmd: diaspora_precompile_assets | |||||
- watch: | |||||
- git: diaspora_git | |||||
- file: {{ diaspora.install_path }}/config/database.yml | |||||
- file: {{ diaspora.install_path }}/config/diaspora.yml |