This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
envs = Hash.new | |
q = Chef::Search::Query.new | |
r, f, l = q.search(:node, "fqdn:*.*") | |
r.each { |n| envs.has_key?(n.chef_environment) ? envs[n.chef_environment] += 1 : envs[n.chef_environment] = 1 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/bin/chef-client | |
rm -f /opt/graphite/webapp/graphite/settings.pyc /opt/graphite/webapp/graphite/settings.py | |
if [ -d "/var/chef/cache/graphite-web-0.9.10" ]; then | |
cd /var/chef/cache/graphite-web-0.9.10 | |
python setup.py install | |
elif [ -d "/var/cache/chef/graphite-web-0.9.10" ]; then | |
cd /var/cache/chef/graphite-web-0.9.10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby_block "create ssh key" do | |
block do | |
k = SSHKey.generate(:type => 'RSA', :bits => 1024, :comment => "Postgres Master") | |
node.set[:postgresql][:pubkey] = k.ssh_public_key | |
node.save | |
# Much of the DSL disappears in ruby blocks. Here's how to create a template. | |
rc = Chef::RunContext.new(node, node.cookbook_collection) | |
t = Chef::Resource::Template.new "/var/lib/postgresql/.ssh/id_rsa" | |
t.source("id_rsa.erb") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rb = ruby_block "wait_for_myself" do | |
action :nothing | |
block do | |
Chef::Log.info "Waiting for service registration to complete" | |
providers = all_providers_for_service("rabbitmq-disk-member") | |
found = false | |
until found | |
providers.each do |n| | |
n.hostname == node.hostname && found = true | |
Chef::Log.info "still waiting... #{providers.join(", ")}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# register with cluster_service_discovery | |
provide_service("nfs-server-for-pentaho") | |
include_recipe "nfs::server" | |
# I think there's the potential for a chicken-and-egg issue here, where the NFS server doesn't | |
# know who to set up exports for, and the clients fail mounting an NFS share that has no permissions. | |
searchenv = node[:pentaho][:nfs_environment] ? node[:pentaho][:nfs_environment] : nil | |
nfs_clients = all_provider_private_ips_services("nfs-client-for-pentaho", :ignore_cluster => true, searchenv.to_a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: pentaho | |
# Recipe:: default | |
# | |
provide_service("nfs-client-for-pentaho") | |
searchenv = node[:pentaho][:nfs_environment] ? node[:pentaho][:nfs_environment] : nil | |
wait_for_service("nfs-server-for-pentaho", 1, 5, true, searchenv) | |
nfs_server = provider_for_service("nfs-server-for-pentaho", true, searchenv) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- src/http/ngx_http_upstream_round_robin.c.orig 2011-09-30 14:30:01.000000000 +0000 | |
+++ src/http/ngx_http_upstream_round_robin.c 2012-01-18 18:38:25.438381169 +0000 | |
@@ -7,13 +7,44 @@ | |
#include <ngx_config.h> | |
#include <ngx_core.h> | |
#include <ngx_http.h> | |
+#include <ngx_supervisord.h> | |
+ | |
+#if (NGX_SUPERVISORD_API_VERSION != 2) | |
+ #error "ngx_supervisord-aware upstream requires NGX_SUPERVISORD_API v2" |
NewerOlder