This file contains 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
task :classify_nodes do | |
@dns_names.each do |description| | |
description =~ /^(.+?)\..+$/ | |
hostname = $1 | |
node = @ic.get_node(hostname) | |
if exists?(:puppet_env) | |
EC2_DATA[:iclassify_attribs]["puppet_env"] = puppet_env | |
end | |
node.tags = EC2_DATA[:iclassify_tags] | |
EC2_DATA[:iclassify_attribs].each do |name, values| |
This file contains 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/sh | |
# | |
# EC2 bootstrap | |
# | |
mkdir /etc/chef | |
mkdir /var/chef | |
cat > /etc/chef/solo.rb <<SOLO | |
cookbook_path "/var/chef/cookbooks" |
This file contains 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
define :mysql_database, :action => 'create' do | |
def mysql(command, config=nil, ) | |
"mysql --defaults-file=#{config} --execute=#{command.inspect}" | |
end | |
include_recipe "mysql::client" | |
# For now, use the super-user conf | |
case @node[:platform] | |
when "debian", "ubuntu" |
This file contains 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 | |
# 1st install Apple's XCode (dev tools, gcc, etc) | |
# Then... Setup | |
cat >$HOME/.bash_profile <<\THEEND | |
export PATH=$HOME/bin:/opt/local/bin:$PATH | |
export MANPATH=$HOME/man:/opt/local/man:$MANPATH | |
if [ -f /opt/local/etc/bash_completion ]; then | |
. /opt/local/etc/bash_completion |
This file contains 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
class TestCLI | |
include Mixlib::CLI | |
option :config_file, | |
:short => "-c CONFIG", | |
:long => "--config CONFIG", | |
:default => 'config.rb', | |
:description => "The configuration file to use" | |
option :log_level, |
This file contains 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
r = service "apache" { action :nothing } | |
r.updated = true | |
r.notifies(:start, r, :delayed) |
This file contains 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:: apt | |
# Recipe:: default | |
# | |
# Copyright 2008, OpsCode, Inc. | |
# | |
# 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 | |
# |
This file contains 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
#!/usr/bin/env ruby | |
# -*- ruby -*- | |
`git checkout opscode/master` | |
Dir.glob("*").select {|x| FileTest.directory?(x) }.each do |path| | |
`git br -D #{path}` | |
`git checkout -b #{path} opscode/master` | |
`git filter-branch --tree-filter \ | |
'rm -rf #{Dir.glob("*").reject {|x| x == path }.join(" ")}' --prune-empty HEAD` | |
`rm -rf .git/refs/original` |
This file contains 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
# | |
# nagios apache configuration | |
# | |
# Generated by Chef for <%= @node[:fqdn] %> | |
# | |
<VirtualHost *:80> | |
ServerAdmin noc@example.com | |
ServerName nagios.prod.example.com | |
ServerAlias nagios |
This file contains 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
define :memcached_instance, :enable => true do | |
runit_service "memcached-#{params[:name]}" do | |
template_name "memcached" | |
options({:max_memory => node[:memcached][:max_memory], | |
:port => node[:memcached][:port], :user => node[:memcached][:user], | |
:max_connections => node[:memcached][:port]}.merge(params)) | |
end | |
service params[:name] do |
OlderNewer