configuration.sls 2.6 KB
Newer Older
Guba Sándor committed
1
manager_postactivate:
Guba Sándor committed
2 3 4 5 6 7 8
  file.managed:
      - name: /home/{{ pillar['user'] }}/.virtualenvs/circle/bin/postactivate
      - source: salt://manager/files/postactivate
      - template: jinja
      - user: {{ pillar['user'] }}
      - mode: 700

9
portal.conf:
10
  file.managed:
Dóbé Péter committed
11
    {% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %}
Bach Dániel committed
12 13 14 15
    - name: /etc/systemd/system/portal.service
    {% else %}
    - name: /etc/init/portal.conf
    {% endif %}
16 17 18
    - user: root
    - group: root
    - template: jinja
Dóbé Péter committed
19
    {% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %}
20

Bach Dániel committed
21 22 23 24 25
    {% if pillar['deployment_type'] == 'production' %}
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.service
    {% else %}
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal.service
    {% endif %}
26 27 28
    
    {% else %}
    
Bach Dániel committed
29
    {% if pillar['deployment_type'] == 'production' %}
30
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal-uwsgi.conf
Bach Dániel committed
31 32 33
    {% else %}
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/portal.conf
    {% endif %}
34 35

    {% endif %}
Bach Dániel committed
36

Dóbé Péter committed
37
{% if grains['os_family'] == 'RedHat' or grains['os'] == 'Debian' %}
Bach Dániel committed
38 39
/etc/systemd/system/manager.service:
  file.managed:
Guba Sándor committed
40 41
    - user: root
    - group: root
42
    - template: jinja
Bach Dániel committed
43 44 45 46 47 48 49 50 51 52 53
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/manager.service

/etc/systemd/system/managercelery@.service:
  file.managed:
    - user: root
    - group: root
    - template: jinja
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/managercelery@.service

{% else %}

Guba Sándor committed
54
/etc/init/manager.conf:
55
  file.managed:
Guba Sándor committed
56 57
    - user: root
    - group: root
58 59
    - template: jinja
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/manager.conf
Bach Dániel committed
60

Guba Sándor committed
61
/etc/init/mancelery.conf:
62
  file.managed:
Guba Sándor committed
63 64
    - user: root
    - group: root
65 66
    - template: jinja
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/mancelery.conf
Guba Sándor committed
67 68

/etc/init/moncelery.conf:
69
  file.managed:
Guba Sándor committed
70 71
    - user: root
    - group: root
72 73
    - template: jinja
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/moncelery.conf
Guba Sándor committed
74 75

/etc/init/slowcelery.conf:
76
  file.managed:
Guba Sándor committed
77 78
    - user: root
    - group: root
79 80
    - template: jinja
    - source: file:///home/{{ pillar['user'] }}/circle/miscellaneous/slowcelery.conf
Bach Dániel committed
81
{% endif %}
Bach Dániel committed
82 83 84 85 86 87 88 89 90 91

salt://manager/files/init.sh:
  cmd.script:
    - template: jinja
    - user: {{ pillar['user'] }}
    - stateful: true
    - require:
      - virtualenv: virtualenv_manager
      - file: /home/{{ pillar['user'] }}/.virtualenvs/circle/bin/postactivate
      - user: {{ pillar['user'] }}