Changeset View
Changeset View
Standalone View
Standalone View
roles/paas-docker/containers/relay.sls
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Salt — Provision Docker engine | # Salt — Provision Docker engine | ||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||
# Project: Nasqueron | # Project: Nasqueron | ||||
# License: Trivial work, not eligible to copyright | # License: Trivial work, not eligible to copyright | ||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
{% set has_selinux = salt['grains.get']('selinux:enabled', False) %} | {% set has_selinux = salt['grains.get']('selinux:enabled', False) %} | ||||
{% for instance, container in pillar['docker_containers']['relay'].items() %} | {% for instance, container in pillar['docker_containers']['relay'].items() %} | ||||
{% set flavour = container.get("flavour", "production") %} | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Data directory | # Data directory | ||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||
/srv/relay/{{ instance }}: | /srv/relay/{{ instance }}: | ||||
file.directory: | file.directory: | ||||
- makedirs: True | - makedirs: True | ||||
/srv/relay/{{ instance }}/config.yml: | /srv/relay/{{ instance }}/config.yml: | ||||
file.managed: | file.managed: | ||||
{% if flavour == "production" %} | |||||
- source: salt://roles/paas-docker/containers/files/relay/config.yml.jinja | - source: salt://roles/paas-docker/containers/files/relay/config.yml.jinja | ||||
{% else %} | |||||
- source: salt://roles/paas-docker/containers/files/relay/dev.yml | |||||
{% endif %} | |||||
- mode: 644 | - mode: 644 | ||||
- template: jinja | - template: jinja | ||||
- context: | - context: | ||||
container: {{ container }} | container: {{ container }} | ||||
relay_{{ instance }}_credentials: | relay_{{ instance }}_credentials: | ||||
docker_container.run: | docker_container.run: | ||||
- image: getsentry/relay:nightly | - image: getsentry/relay:nightly | ||||
- command: bash -c "relay credentials generate --stdout > /work/.relay/credentials.json" | - command: bash -c "relay credentials generate --stdout > /tmp/credentials.json && mv /tmp/credentials.json /work/.relay/" | ||||
- binds: | - binds: | ||||
- /srv/relay/{{ instance }}:/work/.relay | - /srv/relay/{{ instance }}:/work/.relay | ||||
- replace: True | - replace: True | ||||
- creates: /srv/relay/{{ instance }}/credentials.json | - creates: /srv/relay/{{ instance }}/credentials.json | ||||
{% if has_selinux %} | {% if has_selinux %} | ||||
selinux_context_{{ instance }}_relay_data: | selinux_context_{{ instance }}_relay_data: | ||||
selinux.fcontext_policy_present: | selinux.fcontext_policy_present: | ||||
Show All 11 Lines | |||||
{{ instance }}: | {{ instance }}: | ||||
docker_container.running: | docker_container.running: | ||||
- detach: True | - detach: True | ||||
- interactive: True | - interactive: True | ||||
- image: getsentry/relay:nightly | - image: getsentry/relay:nightly | ||||
- binds: | - binds: | ||||
- /srv/relay/{{ instance }}:/work/.relay | - /srv/relay/{{ instance }}:/work/.relay | ||||
{% if flavour == "production" %} | |||||
- /srv/geoip:/usr/local/share/geoip:ro | - /srv/geoip:/usr/local/share/geoip:ro | ||||
{% endif %} | |||||
- ports: | - ports: | ||||
- 3000 | - 3000 | ||||
- port_bindings: | - port_bindings: | ||||
- {{ container['app_port'] }}:3000 | - {{ container['app_port'] }}:3000 | ||||
{% if "network" in container %} | |||||
- networks: | - networks: | ||||
- {{ container['network'] }} | - {{ container['network'] }} | ||||
{% endif %} | |||||
{% endfor %} | {% endfor %} |
Nasqueron DevCentral · If it had been much bigger the moon would have had a core of ice. · Powered by Phabricator