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
{ | |
"webapp": { | |
"web_server": "apache2", | |
"vhosts": [ | |
{ "id": "production", | |
"host_name": "main.example.com", | |
"non_ssl_server": true, | |
"www_redirect": false, | |
"ssl_server": true, | |
"ssl_www_redirect": false |
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
name "base5" | |
description "Contains run list of roles which are safe to run on all RHEL5 and RHEL6 servers." | |
override_attributes "inittab" => { | |
"runlevel" => "3" | |
}, | |
"chef_client" => { | |
"server_url" => "http://chef.example.com:4000", | |
"init_style" => "init" | |
}, | |
"logwatch" => { |
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
{ | |
"id": "stuff", | |
"admin_address": { | |
"_default": "[email protected]", | |
"production": "[email protected]", | |
"development": "[email protected]", | |
} | |
} |
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
namespace :ec2 do | |
# setup chef config | |
# assumes this file is sibling to .chef dir, ex: CHEF_REPO/tasks | |
config = File.join(File.dirname(__FILE__), '..', '.chef', 'knife.rb') | |
Chef::Config.from_file(config) | |
require 'active_support' | |
require 'aws' | |
desc 'Delete any ec2-based chef nodes that no longer exist' |
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
users_manage "sysadmin" do | |
data_bag "users" | |
search_group "sysadmin" | |
group_name "sysadmin" | |
group_id 2000 | |
end |
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
# show the expanded run_list (expands included roles if any): | |
chef > roles.show(“webserver”).run_list.expand | |
chef > roles.show(“webserver”).run_list.expand.roles | |
chef > roles.show(“webserver”).run_list.expand.recipes |
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
p = gem_package("nomnomnom-client") { action :nothing } | |
p.run_action(:install) | |
Gem.clear_paths | |
require 'nom_nom_nom' | |
nomnomnom_servers = [] | |
search(:node, "role:nomnomnom-server") do |server| | |
nomnomnom_servers << server[:ipaddress] | |
end |
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
resource def file (in recipe test for time being) | |
#based on deploy resource; didnt use lwrp because had to pass in a block | |
def initialize(name, collection=nil, node=nil) | |
super(name, collection, node) | |
@resource_name = :test_nested | |
@action = "create" | |
@allowed_actions.push(:create) | |
end |
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
module Autoconf | |
extend self | |
def switches(config=nil) | |
case config | |
when String | |
switch(config) | |
when Enumerable | |
config.map {|item| switch(item) }.join(" ").strip | |
else |