Provision a complete Sentry install using Ansible and (optionally) Vagrant
MIT License
This playbook provides a complete, hassle-free way to setup Sentry on a VPS/Dedicated Server. You can also optionally install it on a Virtual Machine using Vagrant so you can play around with it. This project is a continuation of sentry-vagrant, using Ansible, because I wanted to try that out as well. Turns out, I like it better than Puppet, so I will maintain this version, and probably not the Puppet version.
What gets installed:
If you want to install Sentry on a VM using Vagrant, you first need to install Vagrant and a Virtual Machine provider of choice (VirtualBox is free and works out of the box with Vagrant). You also need to install Ansible.
You can configure your install by modifying the variables in the sentry.yml
file before provisioning.
Note that postgresql may fail to install correctly unless you specify a compatible locale. See https://github.com/ansible/ansible/issues/10698 for some background (ansible forwards the local environment unless you stop it).
Then:
$ git clone https://github.com/DandyDev/sentry-ansible-vagrant.git
$ cd /path/to/sentry-ansible-vagrant
$ vagrant up
In order to properly access Sentry by its configured hostname (sentry.local
in the sentry.yml
), you have to add this hostname to your hostsfile.
On POSIX systems (Linux & OS X), you can add it by doing:
$ sudo echo "192.168.33.10 <servername>" >> /etc/hosts
By default, the Vagrant box runs Ubuntu 12.04, but the playbook supports Debian 7 and CentOS 6.4 as well! To try those out, uncomment the appropriate lines in the Vagrantfile and comment out the Debian lines.
You can of course also use the playbook without Vagrant. In that case you must provide your own inventory file specifying the host on which to install Sentry. The playbook has been tested on Ubuntu 12.04, Debian 7 and CentOS 6.4. Other flavors of Linux might work as well.
On production environments you will want to set the secret_key
setting under
the sentry
namespace to a unique key that acts as a signing token. Generate a
secret key for here.
There's currently no Mail Transfer Agent being installed, like postfix
.
To enable sending mails anyways, you can use an external mail service that
supports sending mail through SMTP. One such service is
Mailgun, which allows sending up to 10,000 mails per
month for free.
To enable mail for sentry, you can edit your Sentry config
(/var/sentry/sentry_conf.py
) and add these variables:
EMAIL_HOST = 'YOUR SMTP HOST'
EMAIL_HOST_USER = 'YOUR SMTP USER'
EMAIL_HOST_PASSWORD = 'YOUR SMTP PASSWORD'
EMAIL_PORT = 25 # or 587/465/etc.
EMAIL_USE_TLS = False
SERVER_EMAIL = 'EMAIL ADDRESS MAILS SHOULD ORIGINATE FROM' # eg. [email protected]
postfix
for this purpose.iptables
, or ifiptables -F
.If you have any suggestions, feel free to create an issue here on Github and/or fork this repo, make changes and submit a pull request!