Commit 9eec2ab9 authored by Ihor Kaharlichenko's avatar Ihor Kaharlichenko
Browse files

Add app role (PPL-139)

parent aa0bd11f
---
- name: Install application infrastructure packages
apt:
name: '{{ item }}'
state: installed
with_items:
- python-virtualenv # pip task dependency
- python-pycurl # apt_repository task dependency
- name: Add PPAs for updated binary python extansions
apt_repository:
repo: 'ppa:{{ item }}'
state: present
update_cache: true
with_items:
- chris-lea/python-simplejson # simplejson dependency
- madkinder/python # setproctitle dependency
# Note, virtualenv WILL NOT get access to system-wide python packages
# if they are installed after virtualenv has been created.
# A virtualenv-wiping handler paired with meta: flush_handlers might help to avoid it.
- name: Install application system-wide dependencies
apt:
name: '{{ item }}'
state: installed
with_items:
- python-tz
- python-psycopg2
- python-simplejson
- python-setproctitle
- name: Install application local dependencies
pip: virtualenv={{ virtualenv_dir }}
name=sentry
version=6.4.4
virtualenv_site_packages=yes
# Create group and user for the service
- name: Create sentry group
group:
name: sentry
state: present
- name: Create sentry user
user:
name: sentry
group: sentry
state: present
- name: Setup Sentry configuration
template:
src: sentry.conf.py.j2
dest: /etc/sentry.conf.py
owner: sentry
group: sentry
mode: 0400
# TODO: Bootstrap the database, if necessary
# TODO: Run as a service using uWSGI
# TODO: Create sentry superusers
# This file is just Python, with a touch of Django which means you
# you can inherit and tweak settings to your hearts content.
from sentry.conf.server import *
import os.path
CONF_ROOT = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '{{ db.name }}',
'USER': '{{ db.user }}',
'PASSWORD': '{{ db.password }}',
'HOST': 'localhost',
'PORT': '',
'OPTIONS': {
'autocommit': True,
}
}
}
# If you're expecting any kind of real traffic on Sentry, we highly recommend
# configuring the CACHES and Redis settings
###########
## CACHE ##
###########
# You'll need to install the required dependencies for Memcached:
# pip install python-memcached
#
# CACHES = {
# 'default': {
# 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
# 'LOCATION': ['127.0.0.1:11211'],
# }
# }
###########
## Queue ##
###########
# See http://sentry.readthedocs.org/en/latest/queue/index.html for more
# information on configuring your queue broker and workers. Sentry relies
# on a Python framework called Celery to manage queues.
# You can enable queueing of jobs by turning off the always eager setting:
# CELERY_ALWAYS_EAGER = False
# BROKER_URL = 'redis://localhost:6379'
####################
## Update Buffers ##
####################
# Buffers (combined with queueing) act as an intermediate layer between the
# database and the storage API. They will greatly improve efficiency on large
# numbers of the same events being sent to the API in a short amount of time.
# (read: if you send any kind of real data to Sentry, you should enable buffers)
# You'll need to install the required dependencies for Redis buffers:
# pip install redis hiredis nydus
#
# SENTRY_BUFFER = 'sentry.buffer.redis.RedisBuffer'
# SENTRY_REDIS_OPTIONS = {
# 'hosts': {
# 0: {
# 'host': '127.0.0.1',
# 'port': 6379,
# }
# }
# }
################
## Web Server ##
################
# You MUST configure the absolute URI root for Sentry:
SENTRY_URL_PREFIX = '{{ sentry_url }}' # No trailing slash!
# If you're using a reverse proxy, you should enable the X-Forwarded-Proto
# and X-Forwarded-Host headers, and uncomment the following settings
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# USE_X_FORWARDED_HOST = True
SENTRY_WEB_HOST = '127.0.0.1' # TODO: Take from variables or use unix domain socket
SENTRY_WEB_PORT = 9000
SENTRY_WEB_OPTIONS = {
'workers': 3, # the number of gunicorn workers
'limit_request_line': 0, # required for raven-js
'secure_scheme_headers': {'X-FORWARDED-PROTO': 'https'},
}
#################
## Mail Server ##
#################
# For more information check Django's documentation:
# https://docs.djangoproject.com/en/1.3/topics/email/?from=olddocs#e-mail-backends
EMAIL_BACKEND = '{{ email.backend }}'
{% if email.backend == 'django.core.mail.backends.smtp.EmailBackend' %}
EMAIL_HOST = '{{ email.host }}'
EMAIL_HOST_PASSWORD = '{{ email.password }}'
EMAIL_HOST_USER = '{{ email.user }}'
EMAIL_PORT = {{ email.port }}
EMAIL_USE_TLS = False
{% endif %}
# The email address to send on behalf of
SERVER_EMAIL = '{{ email.send_from }}'
###########
## etc. ##
###########
# If this file ever becomes compromised, it's important to regenerate your SECRET_KEY
# Changing this value will result in all current sessions being invalidated
SECRET_KEY = '{{ sentry_key }}'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment