Преглед изворни кода

Install diaspora service

tags/v1.0.0
Benjamin Neff пре 7 година
родитељ
комит
e2f2750ffe
No account linked to committer's email address
4 измењених фајлова са 46 додато и 1 уклоњено
  1. +15
    -0
      diaspora/files/diaspora.service
  2. +1
    -1
      diaspora/init.sls
  3. +5
    -0
      diaspora/install.sls
  4. +25
    -0
      diaspora/service.sls

+ 15
- 0
diaspora/files/diaspora.service Прегледај датотеку

@@ -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
- 1
diaspora/init.sls Прегледај датотеку

@@ -1,4 +1,4 @@
include:
- diaspora.install
- diaspora.config
# - diaspora.service
- diaspora.service

+ 5
- 0
diaspora/install.sls Прегледај датотеку

@@ -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:

+ 25
- 0
diaspora/service.sls Прегледај датотеку

@@ -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

Loading…
Откажи
Сачувај