Cookbook for setup and configure sentry application.
The sentry.conf.py file are dynamically generated from attributes.
All default values of attributes you can see in attributes/default.rb
To use the cookbook we recommend creating a cookbook named after the application, e.g. my_app. In metadata.rb you should declare a dependency on this cookbook:
depends "sentry"
Include recipe[sentry]
to you runlist.
Replace you own node['sentry']['key']
random key.
For create new superusers you need overrider node['sentry']['superusers']
attribute:
"superusers" => [{
"username" => "alex",
"password" => "tmppassword",
"email" => "alex@obout.ru"}]
We recommend change temporary passwords after from web interface.
To configure database override node['sentry']['databases']['default']
keys:
"databases" => {
"default" => {
"NAME" => "/var/www/sentry/sentry.db"
},
}
Add "recipe[sentry::instance]"
to you runlist.
Or make you own custom configuration via resouces and definitions.
Create sentry config
sentry_conf "sentry" do
user "sentry"
group "sentry"
virtualenv node["sentry"]["virtualenv"]
# Settings file variables hash
settings {}
end
Create launch instance:
# Running sentry instance
sentry_instance "sentry" do
virtualenv node["sentry"]["virtualenv"]
user node["sentry"]["user"]
group node["sentry"]["group"]
pidfile "/var/run/sentry-1.pid"
config node["sentry"]["config"]
end
You can create config for sentry need use definition sentry_conf
:
sentry_conf "sentry" do
user "sentry"
group "sentry"
virtualenv node["sentry"]["virtualenv"]
# Settings file variables hash
settings {}
end
name
name or path to config file (if config attr not used)template
config template file nameuser
user that own applicationgroup
gtoup that own applicationconfig
path to config filesettings
hash of config variables
To run sentry instance you can user sentry_instance
resouce
name
instance namegroup
launch by groupuser
launch by uservirtualenv
: path to virtualenvconfig
: path to config filepidfile
: path to instance pidfilehost
: host for bindingport
: port for bingingworkers
: number of workersprovider
: instance porvider (default:Chef::Provider::SentryBase
)
sentry cookbook support 3 instance providers:
-
Chef::Provider::SentryBase
- simple provider, that create init.d script and spawn instance -
Chef::Provider::SentryRunit
- provider, that spawn instance viarunit
-
Chef::Provider::SentrySupervisor
- provider, that spawn instance viasupervisord
Base recipe to configure sentry user and group
Recipe to install simple sentry instance.