update node dependency cookbook statsd for swift
This commit is contained in:
parent
e0de4e6a26
commit
c4522d9f5c
@ -0,0 +1 @@
|
||||
metadata
|
@ -0,0 +1,28 @@
|
||||
{
|
||||
"sources": {
|
||||
"statsd": {
|
||||
"path": "."
|
||||
},
|
||||
"build-essential": {
|
||||
"locked_version": "1.4.2"
|
||||
},
|
||||
"git": {
|
||||
"locked_version": "2.6.0"
|
||||
},
|
||||
"dmg": {
|
||||
"locked_version": "2.0.0"
|
||||
},
|
||||
"yum": {
|
||||
"locked_version": "2.3.2"
|
||||
},
|
||||
"windows": {
|
||||
"locked_version": "1.10.0"
|
||||
},
|
||||
"chef_handler": {
|
||||
"locked_version": "1.1.4"
|
||||
},
|
||||
"runit": {
|
||||
"locked_version": "1.2.0"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "chef", "~> 11.4.4"
|
||||
gem "json", "<= 1.7.7" # chef dependency
|
||||
gem "berkshelf", "~> 2.0.10"
|
||||
gem "chefspec", "~> 1.2.0"
|
||||
gem "foodcritic"
|
||||
gem "strainer"
|
@ -0,0 +1,212 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (3.2.14)
|
||||
i18n (~> 0.6, >= 0.6.4)
|
||||
multi_json (~> 1.0)
|
||||
addressable (2.3.5)
|
||||
akami (1.2.0)
|
||||
gyoku (>= 0.4.0)
|
||||
nokogiri (>= 1.4.0)
|
||||
berkshelf (2.0.10)
|
||||
activesupport (~> 3.2.0)
|
||||
addressable (~> 2.3.4)
|
||||
buff-shell_out (~> 0.1)
|
||||
chozo (>= 0.6.1)
|
||||
faraday (>= 0.8.5)
|
||||
hashie (>= 2.0.2)
|
||||
minitar (~> 0.5.4)
|
||||
rbzip2 (~> 0.2.0)
|
||||
retryable (~> 1.3.3)
|
||||
ridley (~> 1.5.0)
|
||||
solve (>= 0.5.0)
|
||||
thor (~> 0.18.0)
|
||||
buff-config (0.4.0)
|
||||
buff-extensions (~> 0.3)
|
||||
varia_model (~> 0.1)
|
||||
buff-extensions (0.5.0)
|
||||
buff-ignore (1.1.0)
|
||||
buff-platform (0.1.0)
|
||||
buff-ruby_engine (0.1.0)
|
||||
buff-shell_out (0.1.0)
|
||||
buff-ruby_engine (~> 0.1.0)
|
||||
builder (3.2.2)
|
||||
celluloid (0.14.1)
|
||||
timers (>= 1.0.0)
|
||||
celluloid-io (0.14.1)
|
||||
celluloid (>= 0.14.1)
|
||||
nio4r (>= 0.4.5)
|
||||
chef (11.4.4)
|
||||
erubis
|
||||
highline (>= 1.6.9)
|
||||
json (>= 1.4.4, <= 1.7.7)
|
||||
mixlib-authentication (>= 1.3.0)
|
||||
mixlib-cli (~> 1.3.0)
|
||||
mixlib-config (>= 1.1.2)
|
||||
mixlib-log (>= 1.3.0)
|
||||
mixlib-shellout
|
||||
net-ssh (~> 2.6)
|
||||
net-ssh-multi (~> 1.1.0)
|
||||
ohai (>= 0.6.0)
|
||||
rest-client (>= 1.0.4, < 1.7.0)
|
||||
yajl-ruby (~> 1.1)
|
||||
chefspec (1.2.0)
|
||||
chef (>= 10.0)
|
||||
erubis
|
||||
fauxhai (>= 0.1.1, < 2.0)
|
||||
minitest-chef-handler (>= 0.6.0)
|
||||
rspec (~> 2.0)
|
||||
chozo (0.6.1)
|
||||
activesupport (>= 3.2.0)
|
||||
hashie (>= 2.0.2)
|
||||
multi_json (>= 1.3.0)
|
||||
ci_reporter (1.9.0)
|
||||
builder (>= 2.1.2)
|
||||
diff-lcs (1.2.4)
|
||||
erubis (2.7.0)
|
||||
faraday (0.8.8)
|
||||
multipart-post (~> 1.2.0)
|
||||
fauxhai (1.1.1)
|
||||
httparty
|
||||
net-ssh
|
||||
ohai
|
||||
ffi (1.9.0)
|
||||
foodcritic (2.2.0)
|
||||
erubis
|
||||
gherkin (~> 2.11.7)
|
||||
nokogiri (~> 1.5.4)
|
||||
treetop (~> 1.4.10)
|
||||
yajl-ruby (~> 1.1.0)
|
||||
gherkin (2.11.8)
|
||||
multi_json (~> 1.3)
|
||||
gssapi (1.0.3)
|
||||
ffi (>= 1.0.1)
|
||||
gyoku (1.1.0)
|
||||
builder (>= 2.1.2)
|
||||
hashie (2.0.5)
|
||||
highline (1.6.19)
|
||||
httparty (0.11.0)
|
||||
multi_json (~> 1.0)
|
||||
multi_xml (>= 0.5.2)
|
||||
httpclient (2.2.0.2)
|
||||
httpi (0.9.7)
|
||||
rack
|
||||
i18n (0.6.5)
|
||||
ipaddress (0.8.0)
|
||||
json (1.7.7)
|
||||
little-plugger (1.1.3)
|
||||
logging (1.6.2)
|
||||
little-plugger (>= 1.1.3)
|
||||
mime-types (1.25)
|
||||
minitar (0.5.4)
|
||||
minitest (4.7.5)
|
||||
minitest-chef-handler (1.0.1)
|
||||
chef
|
||||
ci_reporter
|
||||
minitest (~> 4.7.3)
|
||||
mixlib-authentication (1.3.0)
|
||||
mixlib-log
|
||||
mixlib-cli (1.3.0)
|
||||
mixlib-config (1.1.2)
|
||||
mixlib-log (1.6.0)
|
||||
mixlib-shellout (1.2.0)
|
||||
multi_json (1.7.9)
|
||||
multi_xml (0.5.5)
|
||||
multipart-post (1.2.0)
|
||||
net-http-persistent (2.9)
|
||||
net-ssh (2.6.8)
|
||||
net-ssh-gateway (1.2.0)
|
||||
net-ssh (>= 2.6.5)
|
||||
net-ssh-multi (1.1)
|
||||
net-ssh (>= 2.1.4)
|
||||
net-ssh-gateway (>= 0.99.0)
|
||||
nio4r (0.5.0)
|
||||
nokogiri (1.5.10)
|
||||
nori (1.1.5)
|
||||
ohai (6.18.0)
|
||||
ipaddress
|
||||
mixlib-cli
|
||||
mixlib-config
|
||||
mixlib-log
|
||||
mixlib-shellout
|
||||
systemu
|
||||
yajl-ruby
|
||||
polyglot (0.3.3)
|
||||
rack (1.5.2)
|
||||
rbzip2 (0.2.0)
|
||||
rest-client (1.6.7)
|
||||
mime-types (>= 1.16)
|
||||
retryable (1.3.3)
|
||||
ridley (1.5.2)
|
||||
addressable
|
||||
buff-config (~> 0.2)
|
||||
buff-extensions (~> 0.3)
|
||||
buff-ignore (~> 1.1)
|
||||
buff-shell_out (~> 0.1)
|
||||
celluloid (~> 0.14.0)
|
||||
celluloid-io (~> 0.14.0)
|
||||
erubis
|
||||
faraday (>= 0.8.4)
|
||||
hashie (>= 2.0.2)
|
||||
json (>= 1.7.7)
|
||||
mixlib-authentication (>= 1.3.0)
|
||||
net-http-persistent (>= 2.8)
|
||||
net-ssh
|
||||
nio4r (>= 0.5.0)
|
||||
retryable
|
||||
solve (>= 0.4.4)
|
||||
varia_model (~> 0.1)
|
||||
winrm (~> 1.1.0)
|
||||
rspec (2.14.1)
|
||||
rspec-core (~> 2.14.0)
|
||||
rspec-expectations (~> 2.14.0)
|
||||
rspec-mocks (~> 2.14.0)
|
||||
rspec-core (2.14.5)
|
||||
rspec-expectations (2.14.2)
|
||||
diff-lcs (>= 1.1.3, < 2.0)
|
||||
rspec-mocks (2.14.3)
|
||||
rubyntlm (0.1.1)
|
||||
savon (0.9.5)
|
||||
akami (~> 1.0)
|
||||
builder (>= 2.1.2)
|
||||
gyoku (>= 0.4.0)
|
||||
httpi (~> 0.9)
|
||||
nokogiri (>= 1.4.0)
|
||||
nori (~> 1.0)
|
||||
wasabi (~> 1.0)
|
||||
solve (0.8.1)
|
||||
strainer (3.3.0)
|
||||
berkshelf (~> 2.0)
|
||||
buff-platform (~> 0.1)
|
||||
systemu (2.5.2)
|
||||
thor (0.18.1)
|
||||
timers (1.1.0)
|
||||
treetop (1.4.15)
|
||||
polyglot
|
||||
polyglot (>= 0.3.1)
|
||||
uuidtools (2.1.4)
|
||||
varia_model (0.2.0)
|
||||
buff-extensions (~> 0.2)
|
||||
hashie (>= 2.0.2)
|
||||
wasabi (1.0.0)
|
||||
nokogiri (>= 1.4.0)
|
||||
winrm (1.1.2)
|
||||
gssapi (~> 1.0.0)
|
||||
httpclient (~> 2.2.0.2)
|
||||
logging (~> 1.6.1)
|
||||
nokogiri (~> 1.5.0)
|
||||
rubyntlm (~> 0.1.1)
|
||||
savon (= 0.9.5)
|
||||
uuidtools (~> 2.1.2)
|
||||
yajl-ruby (1.1.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
berkshelf (~> 2.0.10)
|
||||
chef (~> 11.4.4)
|
||||
chefspec (~> 1.2.0)
|
||||
foodcritic
|
||||
json (<= 1.7.7)
|
||||
strainer
|
@ -1,69 +1,53 @@
|
||||
# DESCRIPTION
|
||||
Description
|
||||
===========
|
||||
|
||||
Chef cookbook to install [Etsy's
|
||||
StatsD](https://github.com/etsy/statsd) daemon. Supports the new
|
||||
pluggable backend modules.
|
||||
Installs and sets up statsd <http://github.com/etsy/statsd>
|
||||
|
||||
# REQUIREMENTS
|
||||
Requirements
|
||||
============
|
||||
|
||||
Depends on the cookbooks:
|
||||
Ubuntu 12.04
|
||||
|
||||
* git
|
||||
* nodejs
|
||||
Attributes
|
||||
==========
|
||||
|
||||
# ATTRIBUTES
|
||||
* `node['statsd']['port']` - The port for Statsd to listen for stats on. Defaults to 8125
|
||||
* `node['statsd']['graphite_host']` - The host to forward processed statistics to. Defaults to localhost.
|
||||
* `node['statsd']['graphite_port']` - The port to forward processed statistics to. Defaults to 2003
|
||||
* `node['statsd']['package_version']` - The version to use when creating the package. Defaults to 0.6.0
|
||||
* `node['statsd']['tmp_dir']` - The temporary directory to while building the package. Defaults to /tmp
|
||||
* `node['statsd']['repo']` - The gitrepo to use. Defaults to "git://github.com/etsy/statsd.git"
|
||||
* `node['statsd']['sha']` - The sha checksum of the repo to use
|
||||
|
||||
## Basic attributes
|
||||
Usage
|
||||
=====
|
||||
|
||||
* `repo`: Location of statsd repo (defaults to Etsy's).
|
||||
* `log_file`: Where to log output (defaults to:
|
||||
`/var/log/statsd.log`).
|
||||
* `flush_interval_msecs`: Flush interval in msecs (default 10000).
|
||||
* `port`: Port to listen for UDP stats (default 8125).
|
||||
Including this recipe will build a dpkg from the statsd git repository and install it.
|
||||
|
||||
## Graphite settings
|
||||
By default statsd will attempt to send statistics to a graphite instance running on localhost.
|
||||
|
||||
* `graphite_enabled`: Enable the built-in Graphite backend (default true).
|
||||
* `graphite_port`: Port to talk to Graphite on (default 2003).
|
||||
* `graphite_host`: Host name of Graphite server (default localhost).
|
||||
Testing
|
||||
=======
|
||||
|
||||
## Adding backends
|
||||
$ bundle install
|
||||
$ bundle exec berks install
|
||||
$ bundle exec strainer test
|
||||
|
||||
Set the attribute `backends` to a hash of statsd NPM module
|
||||
backends. The hash key is the name of the NPM module, while the hash
|
||||
value is the version of the NPM module to install (or null for latest
|
||||
version).
|
||||
License and Author
|
||||
==================
|
||||
|
||||
For example, to use version 0.0.1 of [statsd-librato-backend][]:
|
||||
Author:: Scott Lampert (<sl724q@att.com>)
|
||||
|
||||
attrs[:statsd][:backends] = { 'statsd-librato-backend' => '0.0.1' }
|
||||
Copyright 2012-2013, AT&T Services, Inc.
|
||||
|
||||
To use the latest version of statsd-librato-backend:
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
attrs[:statsd][:backends] = { 'statsd-librato-backend' => nil }
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
The cookbook will install each backend module under the statsd
|
||||
directory and add it to the list of backends loaded in the
|
||||
configuration file.
|
||||
|
||||
### Extra backend configuration
|
||||
|
||||
Set the attribute `extra_config` to any additional configuration
|
||||
options that should be included in the StatsD configuration file.
|
||||
|
||||
For example, to set your email and token for the
|
||||
[statsd-librato-backend][] backend module, use the following:
|
||||
|
||||
```js
|
||||
attrs[:statsd][:extra_config] => {
|
||||
'librato' => {
|
||||
'email' => 'myemail@example.com',
|
||||
'token' => '1234567890ABCDEF'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# USAGE
|
||||
|
||||
|
||||
[statsd-librato-backend]: https://github.com/librato/statsd-librato-backend
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
@ -0,0 +1,4 @@
|
||||
# Strainerfile
|
||||
knife test: bundle exec knife cookbook test $COOKBOOK
|
||||
foodcritic: bundle exec foodcritic -f any -t ~FC003 -t ~FC023 $SANDBOX/$COOKBOOK
|
||||
chefspec: bundle exec rspec $SANDBOX/$COOKBOOK
|
@ -1,32 +1,9 @@
|
||||
default[:statsd][:repo] = "git://github.com/etsy/statsd.git"
|
||||
default[:statsd][:revision] = "master"
|
||||
|
||||
default[:statsd][:log_file] = "/var/log/statsd.log"
|
||||
|
||||
default[:statsd][:flush_interval_msecs] = 10000
|
||||
default[:statsd][:port] = 8125
|
||||
|
||||
# Is the graphite backend enabled?
|
||||
default[:statsd][:graphite_enabled] = true
|
||||
default[:statsd][:graphite_port] = 2003
|
||||
default[:statsd][:graphite_host] = "localhost"
|
||||
|
||||
#
|
||||
# Add all NPM module backends here. Each backend should be a
|
||||
# hash of the backend's name to the NPM module's version. If we
|
||||
# should just use the latest, set the hash to null.
|
||||
#
|
||||
# For example, to use version 0.0.1 of statsd-librato-backend:
|
||||
#
|
||||
# attrs[:statsd][:backends] = { 'statsd-librato-backend' => '0.0.1' }
|
||||
#
|
||||
# To use the latest version of statsd-librato-backend:
|
||||
#
|
||||
# attrs[:statsd][:backends] = { 'statsd-librato-backend' => nil }
|
||||
#
|
||||
default[:statsd][:backends] = {}
|
||||
|
||||
#
|
||||
# Add any additional backend configuration here.
|
||||
#
|
||||
default[:statsd][:extra_config] = {}
|
||||
default['statsd']['port'] = 8125
|
||||
default['statsd']['graphite_port'] = 2003
|
||||
default['statsd']['graphite_host'] = "localhost"
|
||||
default['statsd']['relay_server'] = false
|
||||
default['statsd']['package_version'] = "0.6.0"
|
||||
default['statsd']['sha'] = "2ccde8266bbe941ac5f79efe39103b99e1196d92"
|
||||
default['statsd']['user'] = "statsd"
|
||||
default['statsd']['repo'] = "git://github.com/etsy/statsd.git"
|
||||
default['statsd']['tmp_dir'] = "/tmp"
|
||||
|
@ -1,12 +1,8 @@
|
||||
description "statsd"
|
||||
author "Librato"
|
||||
author "etsy"
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on runlevel [!2345]
|
||||
|
||||
env SL_NAME=statsd
|
||||
|
||||
respawn
|
||||
start on startup
|
||||
stop on shutdown
|
||||
|
||||
script
|
||||
# We found $HOME is needed. Without it, we ran into problems
|
||||
|
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
# Called by Upstart, /etc/init/statsd.conf
|
||||
node /usr/share/statsd/stats.js /etc/statsd/localConfig.js 2>&1 >> /tmp/statsd.log
|
@ -1,12 +1,16 @@
|
||||
maintainer "Mike Heffner"
|
||||
maintainer_email "mike@librato.com"
|
||||
name "statsd"
|
||||
maintainer "AT&T Services, Inc."
|
||||
maintainer_email "cookbooks@lists.tfoundry.com"
|
||||
license "Apache 2.0"
|
||||
description "Installs/Configures statsd"
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version "0.1.1"
|
||||
version "0.1.4"
|
||||
recipe "statsd", "Installs stats ruby gem"
|
||||
recipe "statsd::server", "Configures statsd server"
|
||||
|
||||
depends "build-essential"
|
||||
depends "git"
|
||||
depends "nodejs", ">= 0.5.2"
|
||||
%w{ ubuntu }.each do |os|
|
||||
supports os
|
||||
end
|
||||
|
||||
supports "ubuntu"
|
||||
depends "build-essential"
|
||||
depends "git"
|
||||
|
@ -2,109 +2,19 @@
|
||||
# Cookbook Name:: statsd
|
||||
# Recipe:: default
|
||||
#
|
||||
# Copyright 2011, Librato, Inc.
|
||||
# Copyright 2013, Scott Lampert
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include_recipe "nodejs"
|
||||
include_recipe "git"
|
||||
|
||||
git "/usr/share/statsd" do
|
||||
repository node[:statsd][:repo]
|
||||
revision node[:statsd][:revision]
|
||||
action :sync
|
||||
end
|
||||
|
||||
execute "install dependencies" do
|
||||
command "npm install -d"
|
||||
cwd "/usr/share/statsd"
|
||||
end
|
||||
|
||||
backends = []
|
||||
|
||||
if node[:statsd][:graphite_enabled]
|
||||
backends << "./backends/graphite"
|
||||
end
|
||||
|
||||
node[:statsd][:backends].each do |k, v|
|
||||
if v
|
||||
name = "#{k}@#{v}"
|
||||
else
|
||||
name= k
|
||||
end
|
||||
|
||||
execute "install npm module #{name}" do
|
||||
command "npm install #{name}"
|
||||
cwd "/usr/share/statsd"
|
||||
end
|
||||
|
||||
backends << k
|
||||
end
|
||||
|
||||
directory "/etc/statsd" do
|
||||
action :create
|
||||
end
|
||||
|
||||
user "statsd" do
|
||||
comment "statsd"
|
||||
system true
|
||||
shell "/bin/false"
|
||||
end
|
||||
|
||||
service "statsd" do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
|
||||
restart_command "stop statsd; start statsd"
|
||||
start_command "start statsd"
|
||||
stop_command "stop statsd"
|
||||
|
||||
supports :restart => true, :start => true, :stop => true
|
||||
end
|
||||
|
||||
template "/etc/statsd/config.js" do
|
||||
source "config.js.erb"
|
||||
mode 0644
|
||||
|
||||
config_hash = {
|
||||
:flushInterval => node[:statsd][:flush_interval_msecs],
|
||||
:port => node[:statsd][:port],
|
||||
:backends => backends
|
||||
}.merge(node[:statsd][:extra_config])
|
||||
|
||||
if node[:statsd][:graphite_enabled]
|
||||
config_hash[:graphitePort] = node[:statsd][:graphite_port]
|
||||
config_hash[:graphiteHost] = node[:statsd][:graphite_host]
|
||||
end
|
||||
|
||||
variables(:config_hash => config_hash)
|
||||
|
||||
notifies :restart, resources(:service => "statsd")
|
||||
end
|
||||
|
||||
directory "/usr/share/statsd/scripts" do
|
||||
action :create
|
||||
end
|
||||
|
||||
template "/usr/share/statsd/scripts/start" do
|
||||
source "upstart.start.erb"
|
||||
mode 0755
|
||||
|
||||
notifies :restart, resources(:service => "statsd")
|
||||
end
|
||||
|
||||
cookbook_file "/etc/init/statsd.conf" do
|
||||
source "upstart.conf"
|
||||
mode 0644
|
||||
|
||||
notifies :restart, resources(:service => "statsd")
|
||||
end
|
||||
|
||||
bash "create_log_file" do
|
||||
code <<EOH
|
||||
touch #{node[:statsd][:log_file]} && chown statsd #{node[:statsd][:log_file]}
|
||||
EOH
|
||||
not_if {File.exist?(node[:statsd][:log_file])}
|
||||
end
|
||||
|
||||
service "statsd" do
|
||||
action [ :enable, :start ]
|
||||
end
|
||||
gem_package "statsd-ruby"
|
||||
|
@ -0,0 +1,87 @@
|
||||
#
|
||||
# Cookbook Name:: statsd
|
||||
# Recipe:: server
|
||||
#
|
||||
# Copyright 2013, Scott Lampert
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include_recipe "build-essential"
|
||||
include_recipe "git"
|
||||
|
||||
case node["platform"]
|
||||
when "ubuntu", "debian"
|
||||
|
||||
package "nodejs"
|
||||
package "debhelper"
|
||||
|
||||
statsd_version = node['statsd']['sha']
|
||||
|
||||
git ::File.join(node['statsd']['tmp_dir'], "statsd") do
|
||||
repository node['statsd']['repo']
|
||||
reference statsd_version
|
||||
action :sync
|
||||
notifies :run, "execute[build debian package]"
|
||||
end
|
||||
|
||||
# Fix the debian changelog file of the repo
|
||||
template ::File.join(node['statsd']['tmp_dir'], "statsd/debian/changelog") do
|
||||
source "changelog.erb"
|
||||
end
|
||||
|
||||
execute "build debian package" do
|
||||
command "dpkg-buildpackage -us -uc"
|
||||
cwd ::File.join(node['statsd']['tmp_dir'], "statsd")
|
||||
creates ::File.join(node['statsd']['tmp_dir'], "statsd_#{node['statsd']['package_version']}_all.deb")
|
||||
end
|
||||
|
||||
dpkg_package "statsd" do
|
||||
action :install
|
||||
source ::File.join(node['statsd']['tmp_dir'], "statsd_#{node['statsd']['package_version']}_all.deb")
|
||||
end
|
||||
|
||||
when "redhat", "centos"
|
||||
raise "No support for RedHat or CentOS (yet)."
|
||||
end
|
||||
|
||||
template "/etc/statsd/localConfig.js" do
|
||||
source "localConfig.js.erb"
|
||||
mode 00644
|
||||
notifies :restart, "service[statsd]"
|
||||
end
|
||||
|
||||
cookbook_file "/usr/share/statsd/scripts/start" do
|
||||
source "upstart.start"
|
||||
owner "root"
|
||||
group "root"
|
||||
mode 00755
|
||||
end
|
||||
|
||||
cookbook_file "/etc/init/statsd.conf" do
|
||||
source "upstart.conf"
|
||||
owner "root"
|
||||
group "root"
|
||||
mode 00644
|
||||
end
|
||||
|
||||
user node['statsd']['user'] do
|
||||
comment "statsd"
|
||||
system true
|
||||
shell "/bin/false"
|
||||
end
|
||||
|
||||
service "statsd" do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
action [ :enable, :start ]
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
statsd (<%= node['statsd']['package_version'] %>) unstable; urgency=low
|
||||
|
||||
* Dummy changelog for dpkg build
|
||||
|
||||
-- Scott Lampert <scott@lampert.org> Thu, 14 Mar 2013 15:24:00 -0700
|
@ -1 +0,0 @@
|
||||
<%= JSON.pretty_generate(@config_hash) %>
|
@ -0,0 +1,17 @@
|
||||
/********************
|
||||
AUTOGENERATED BY CHEF
|
||||
*********************/
|
||||
|
||||
{
|
||||
graphitePort: <%= node['statsd']['graphite_port'] %>
|
||||
, graphiteHost: "<%= node['statsd']['graphite_host'] %>"
|
||||
<% if node['statsd']['relay_server'] -%>
|
||||
, address: "127.0.0.1"
|
||||
, mgmt_address: "127.0.0.1"
|
||||
<% else -%>
|
||||
, address: "<%= node['statsd']['graphite_host'] %>"
|
||||
, mgmt_address: "<%=node['statsd']['graphite_host'] %>"
|
||||
<% end -%>
|
||||
, port: <%= node['statsd']['port'] %>
|
||||
, backends: [ "./backends/graphite" ]
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Called by Upstart, /etc/init/statsd.conf
|
||||
|
||||
export PATH=$PATH:/usr/local/bin
|
||||
|
||||
node /usr/share/statsd/stats.js /etc/statsd/config.js 2>&1 >> <%= node[:statsd][:log_file] %>
|
Loading…
x
Reference in New Issue
Block a user