@@ -0,0 +1,15 @@ | |||
[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 |
@@ -1,4 +1,4 @@ | |||
include: | |||
- diaspora.install | |||
- diaspora.config | |||
# - diaspora.service | |||
- diaspora.service |
@@ -21,6 +21,10 @@ diaspora_database_dependency: | |||
redis_package: | |||
pkg.installed: | |||
- name: {{ diaspora.redis_package }} | |||
redis_service: | |||
service.running: | |||
- name: {{ diaspora.redis_service }} | |||
{%- endif %} | |||
diaspora_user: | |||
@@ -113,6 +117,7 @@ diaspora_create_database: | |||
- env: | |||
- RAILS_ENV: {{ diaspora.environment }} | |||
- require: | |||
- cmd: diaspora_bundle_install | |||
- file: {{ diaspora.install_path }}/config/database.yml | |||
- file: {{ diaspora.install_path }}/config/diaspora.yml | |||
- onchanges: |
@@ -0,0 +1,25 @@ | |||
{%- 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 |