Page MenuHomeDevCentral

No OneTemporary

diff --git a/pillar/paas/docker/dwellers/sentry.sls b/pillar/paas/docker/dwellers/sentry.sls
new file mode 100644
index 0000000..77ce4fe
--- /dev/null
+++ b/pillar/paas/docker/dwellers/sentry.sls
@@ -0,0 +1,16 @@
+# -------------------------------------------------------------
+# Salt — Provision Docker engine
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Service: Sentry
+# -------------------------------------------------------------
+
+docker_images:
+ - getsentry/relay:nightly
+
+docker_containers:
+ relay:
+ sentry_relay:
+ app_port: 26300
+ flavour: dev
diff --git a/pillar/top.sls b/pillar/top.sls
index 0a8674a..589c807 100644
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -1,56 +1,55 @@
# -------------------------------------------------------------
# Salt configuration for Nasqueron servers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-04-10
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
base:
'*':
- core.users
- core.groups
- core.network
- certificates.certificates
- nodes.nodes
- nodes.forests
- hotfixes.roles
- webserver.sites
cloudhugger:
- opensearch.software
- opensearch.clusters
complector:
- credentials.vault
docker-002:
- notifications.config
- paas.docker
- saas.jenkins
- saas.phpbb
db-A-001:
- dbserver.cluster-A
dwellers:
- paas.docker
- saas.jenkins
- - saas.sentry
eglide:
- shellserver.quassel
ysul:
- devserver.repos
- saas.mediawiki
- viperserv.bots
- viperserv.fantoir
- webserver.labs
- webserver.wwwroot51
windriver:
- devserver.ports
- devserver.repos
- webserver.labs
- webserver.wwwroot51
diff --git a/roles/paas-docker/containers/files/relay/dev.yml b/roles/paas-docker/containers/files/relay/dev.yml
new file mode 100644
index 0000000..fe1a95d
--- /dev/null
+++ b/roles/paas-docker/containers/files/relay/dev.yml
@@ -0,0 +1,25 @@
+# -------------------------------------------------------------
+# Sentry configuration - Relay
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/paas-docker/containers/files/relay/dev.yml
+# Description: Relay instance capturing messages for Sentry SDK
+# development, and high logging level
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+relay:
+ mode: capture
+
+ host: 0.0.0.0
+ port: 3000
+
+logging:
+ level: trace
diff --git a/roles/paas-docker/containers/relay.sls b/roles/paas-docker/containers/relay.sls
index 375e830..935fefc 100644
--- a/roles/paas-docker/containers/relay.sls
+++ b/roles/paas-docker/containers/relay.sls
@@ -1,67 +1,76 @@
# -------------------------------------------------------------
# Salt — Provision Docker engine
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{% set has_selinux = salt['grains.get']('selinux:enabled', False) %}
{% for instance, container in pillar['docker_containers']['relay'].items() %}
+{% set flavour = container.get("flavour", "production") %}
# -------------------------------------------------------------
# Data directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/srv/relay/{{ instance }}:
file.directory:
- makedirs: True
/srv/relay/{{ instance }}/config.yml:
file.managed:
+ {% if flavour == "production" %}
- 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
- template: jinja
- context:
container: {{ container }}
relay_{{ instance }}_credentials:
docker_container.run:
- 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:
- /srv/relay/{{ instance }}:/work/.relay
- replace: True
- creates: /srv/relay/{{ instance }}/credentials.json
{% if has_selinux %}
selinux_context_{{ instance }}_relay_data:
selinux.fcontext_policy_present:
- name: /srv/relay/{{ instance }}
- sel_type: container_file_t
selinux_context_{{ instance }}_relay_data_applied:
selinux.fcontext_policy_applied:
- name: /srv/relay/{{ instance }}
{% endif %}
# -------------------------------------------------------------
# Container
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ instance }}:
docker_container.running:
- detach: True
- interactive: True
- image: getsentry/relay:nightly
- binds:
- /srv/relay/{{ instance }}:/work/.relay
+{% if flavour == "production" %}
- /srv/geoip:/usr/local/share/geoip:ro
+{% endif %}
- ports:
- 3000
- port_bindings:
- {{ container['app_port'] }}:3000
+{% if "network" in container %}
- networks:
- {{ container['network'] }}
+{% endif %}
{% endfor %}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Nov 24, 20:35 (9 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2258907
Default Alt Text
(5 KB)

Event Timeline