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
$ knife cookbook site install apt -V | |
Installing apt to ./cookbooks | |
Checking out the master branch. | |
Creating pristine copy branch chef-vendor-apt | |
Downloading apt from the cookbooks site at version 1.1.2 to ./cookbooks/apt.tar.gz | |
Cookbook saved: ./cookbooks/apt.tar.gz | |
Removing pre-existing version. | |
Uncompressing apt version ./cookbooks. | |
ERROR: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [0], but received '1' | |
---- Begin output of tar zxvf ./cookbooks/apt.tar.gz ---- |
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
class KnifeCliTemplate | |
include Mixlib::CLI | |
end | |
data = {...} | |
KnifeCliTemplate.option(:config_file, :long => '--file FILE', :default => '/etc/chef/knife.rb') | |
KnifeCliTemplate.option(:no_editor, :long => "--no-editor", :boolean => true) | |
args = ['client', 'create', data[:name], '--file', data[:file], '--no-editor' ] | |
args << '--admin' if data[:admin] | |
::Chef::Knife.run(args,KnifeCliTemplate.options) |
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
name "base" | |
description "Baseline configuration for all systems." | |
run_list( | |
"recipe[ohai]", | |
"recipe[chef-client::delete_validation]", | |
"recipe[chef-client]", | |
"recipe[zsh]", | |
"recipe[git]", | |
"recipe[users]", |
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 -*- | |
# Needs following parameters configured in rake.rb: | |
# DNS_DOMAIN: domain for which to set entries, including trailing dot | |
# (e.g. "example.com.") | |
# DNS_ATTRIBUTE: attribute containing hostname to CNAME to, defaults | |
# to 'fqdn'; for EC2, use "ec2.public_hostname" | |
# DNS_ENTRIES: hash mapping hostname to node search query, | |
# e.g. {'buildbot' => 'recipes:buildbot', 'monitoring' => | |
# 'roles:monitoring'} |
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
runit_service "activemq" do | |
env({'ACTIVEMQ_OPTS' => '-Xmx4096M' }) | |
end |
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
o.data[:languages][:java] | |
=> {"runtime"=>{"name"=>"Java(TM) SE Runtime Environment", "build"=>"1.6.0_22-b04"}, "version"=>"1.6.0_22"} | |
irb(main):016:0> |
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
require 'chef' | |
require 'chef/node' | |
class Opscode | |
class Backup | |
attr_accessor :backup_dir | |
def initialize(backup_dir, config_file) | |
@backup_dir = backup_dir | |
Chef::Config.from_file(config_file) |
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
log_level :debug | |
log_location STDOUT | |
validation_client_name 'channels-staging-validator' | |
validation_key './.chef/channels-staging-validator.pem' | |
chef_server_url 'https://api.opscode.com/organizations/channels-staging' | |
cache_options( :path => './.chef/channels-staging-checksums' ) |
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
#!/usr/bin/ruby | |
# lists hosts whose chef-client hasn't checked in with the server for a while | |
# how many seconds before we alert | |
threshold = 3600 | |
# requires that your user account is set up for Chef's "knife" utility | |
me = ENV["USER"] |
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
#! /usr/bin/env ruby | |
# | |
require 'rubygems' | |
require 'hmac-sha1' # on OS X: sudo gem install ruby-hmac | |
require 'net/https' | |
require 'base64' | |
# | |
# CHANGE ME: S3 access credentials go here, along with CloudFront Distribution ID | |
# |