Skip to content

Instantly share code, notes, and snippets.

View maplebed's full-sized avatar

Ben Hartshorne maplebed

View GitHub Profile
# make the images directory writable by apache's user so that we can upload stuff
directory "#{node['mediawiki']['directory']}/images" do
owner "www-data"
mode "0755"
recursive true
end
:( ( 05/02/13@12:02PM )( ben@BenH ):~/git/opscode-cookbooks/zsh@master✔
➜ bundle exec kitchen test 1
-----> Starting Kitchen
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ShellOut::ShellCommandFailed
>>>>>> Message: Expected process to exit with [0], but received '231'
---- Begin output of vagrant --version ----
STDOUT:
STDERR: Vagrant failed to initialize at a very early stage:
:( ( 04/29/13@ 1:41PM )( ben@BenH ):~chef/cookbooks/ganglia_parse@master✗ ✭
➜ berks update 1
Using ganglia (0.1.2) at path: '/Users/ben/git/chef-repo/cookbooks/ganglia'
Using ganglia_parse (0.1.0) at path: '/Users/ben/git/chef-repo/cookbooks/ganglia_parse'
Using graphite (0.4.2)
Using python (1.2.2)
Using build-essential (1.4.0)
Using yum (2.2.0)
Using apache2 (1.6.2)
Using runit (0.16.2)
➜ cat metadata.rb 1
name "apt"
maintainer "Opscode, Inc."
maintainer_email "[email protected]"
license "Apache 2.0"
description "Configures apt and apt services and LWRPs for managing apt repositories and preferences"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.7.0"
recipe "apt", "Runs apt-get update during compile phase and sets up preseed directories"
recipe "apt::cacher-ng", "Set up an apt-cacher-ng caching proxy"
task :start_robut do
run "cd #{current_path}/devtools/pfbot; nohup bundle exec robut > /dev/null 2>&1 & sleep2"
end
task :start_robut do
run "cd #{current_path}/devtools/pfbot; nohup bundle exec robut > /dev/null 2>&1 &"
end
1.9.3p327 :009 > a = true
=> true
1.9.3p327 :010 > template = "a is <%= a %>."
=> "a is <%= a %>."
1.9.3p327 :011 > ERB.new(template).result(binding)
=> "a is true."
This works in chef11 but not chef10. Do I try and make it work or sigh and force a chef client upgrade?
26 needs_mongo_gem = (node.recipe?("mongodb::replicaset") or node.recipe?("mongodb::mongos"))
27
28 if needs_mongo_gem
29 # install the mongo ruby gem at compile time to make it globally available
30 gem_package 'mongo' do
31 action :nothing
32 end.run_action(:install)
33 Gem.clear_paths
@maplebed
maplebed / gist:5086156
Created March 4, 2013 22:11
Only install the ganglia module if the ganglia cookbook exists
# if the host has ganglia, install the mongo plugin.
if node.recipes.include?("ganglia::default")
include_recipe "ganglia::default"
ganglia_python "mongodb" do
action :enable
end
end
def Init_Metric (line, name, tmax, type, units, slope, fmt, desc, handler):
'''Create a metric definition dictionary object for a device.'''
metric_name = line[0] + '-' + name
d = {'name': metric_name.replace('/', '-').lstrip('-'),
'call_back': handler,
'time_max': tmax,
'value_type': type,
'units': units,
'slope': slope,