sentry-cookbook
sentry-cookbook copied to clipboard
Chef cookbook for sentry
Description
Cookbook for setup and configure sentry application.
Requirements
Attributes
The sentry.conf.py file are dynamically generated from attributes.
All default values of attributes you can see in attributes/default.rb
Usage
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" => "[email protected]"}]
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
Definitions
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
Attributes
namename or path to config file (if config attr not used)templateconfig template file nameuseruser that own applicationgroupgtoup that own applicationconfigpath to config filesettingshash of config variables
Resources
sentry_instance
To run sentry instance you can user sentry_instance resouce
Attribute parameters
nameinstance namegrouplaunch by groupuserlaunch 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)
Providers
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
Recipes
default
Base recipe to configure sentry user and group
instance
Recipe to install simple sentry instance.