Skip to content

Instantly share code, notes, and snippets.

@viq
Created November 14, 2013 15:45
Show Gist options
  • Save viq/7469039 to your computer and use it in GitHub Desktop.
Save viq/7469039 to your computer and use it in GitHub Desktop.
sentry-reqs:
pkg.installed:
- pkgs:
- python-virtualenv
- supervisor
- python-pip
- virtualenvwrapper
- postgresql-server-dev-all
- python-dev
- require_in:
- sentry
postgresql:
pkg:
- installed
service:
- running
- enable: True
- watch:
- pkg: postgresql
sentry_db:
postgres_database.present:
- name: {{ salt['pillar.get']('sentry:db:db_name') }}
- owner: {{ salt['pillar.get']('sentry:db:db_user') }}
- require:
- postgres_user: {{ salt['pillar.get']('sentry:db:db_user') }}
postgres_user.present:
- name: {{ salt['pillar.get']('sentry:db:db_user') }}
- password: {{ salt['pillar.get']('sentry:db:db_password') }}
sentry:
virtualenv.managed:
- name: /opt/sentry
- require:
- pkg: sentry-reqs
pip.installed:
- name: sentry[postgres]
- bin_env: /opt/sentry
- require:
- virtualenv: sentry
file.managed:
- name: /etc/sentry/sentry.conf.py
- source: salt://sentry/sentry.conf.py
- template: jinja
sentry_service:
file.managed:
- name: /etc/supervisor/conf.d/sentry.conf
- source: salt://sentry/supervisor_sentry.conf
- require:
- pkg: sentry-reqs
supervisord:
- name: sentry
- running
- watch:
- file: /etc/supervisor/conf.d/sentry.conf
- file: /etc/sentry/sentry.conf.py
- require:
- pip: sentry
import os.path
from sentry.conf.server import *
ROOT = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # We suggest PostgreSQL for optimal performance
'NAME': '{{ salt['pillar.get']('sentry:db:db_name') }}',
'USER': '{{ salt['pillar.get']('sentry:db:db_user') }}',
'PASSWORD': '{{ salt['pillar.get']('sentry:db:db_password') }}',
'HOST': '127.0.0.1',
'PORT': '',
'OPTIONS': {
'autocommit': True,
}
}
}
# No trailing slash!
SENTRY_URL_PREFIX = 'http://saltmaster:9000'
# SENTRY_KEY is a unique randomly generated secret key for your server, and it
# acts as a signing token
SENTRY_KEY = '0123456789abcde'
SENTRY_WEB_HOST = '0.0.0.0'
SENTRY_WEB_PORT = 9000
SENTRY_WEB_OPTIONS = {
'workers': 3, # the number of gunicorn workers
'secure_scheme_headers': {'X-FORWARDED-PROTO': 'https'}, # detect HTTPS mode from X-Forwarded-Proto header
}
SENTRY_PUBLIC = True
SENTRY_ALLOW_PROJECT_CREATION = True
SENTRY_ALLOW_TEAM_CREATION = False
[program:sentry]
command=/opt/sentry/bin/sentry --config=/etc/sentry/sentry.conf.py start http
environment=PATH="/opt/sentry/bin"
autostart=true
autorestart=true
redirect_stderr=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment