Skip to content

Instantly share code, notes, and snippets.

View double-z's full-sized avatar

Zack Zondlo double-z

View GitHub Profile
require 'json'
my_json = { :array => [1, 2, 3, { :sample => "hash"} ], :foo => "bar" }
puts JSON.pretty_generate(my_json)
Which gets you...
{
"array": [
1,
2,
3,
# installs a standalone sensu check
# sensu_standalone_check "unicorn_master" do
# command "#{node.sensu.directory}/plugins/processes/check-procs.rb"
# arguments "-f #{deploy_to}/shared/pids/unicorn.pid"
# end
define :sensu_standalone_check, :interval => 60, :enable => true, :owner => "root", :mode => 0644 do
include_recipe "sensu::_config"
require "chef/handler"
class StatusAttributeHandler < Chef::Handler
VERSION = "0.0.1"
DEFAULTS = {
:attribute_name => 'status',
:success_status => 'UP'
}
/etc/sensu/conf.d/checks/thresholds/logstash-elasticsearch.json
{
"client": {
"params": {
"cpu": {
"warning": 80,
"critical": 90
},
"iowait": {
Dir.glob(File.join(File.dirname(__FILE__), "cookbooks", "*")).each do |cb|
cookbook File.basename(cb), :path => cb
end
source 'https://rubygems.org'
group :test do
gem 'chefspec', '~> 1.3'
gem 'foodcritic', '~> 2.1'
gem 'strainer', '~> 3.0'
gem 'test-kitchen', '~> 1.0.0.alpha'
gem 'kitchen-lxc', '~> 0.0.1.beta1'
gem 'knife-spork', '~> 1.0.17'
gem 'hipchat', '~> 0.10.0'

getchef4-test1

[gfm] Introducing Chef Metal 0.2! Chef Metal is a framework that lets you manage your *clusters* with Chef the same way you manage machines: with recipes. Combined with the power of Chef, Metal's `machine` resource helps you to describe, version, deploy and manage everything from simple to complex clusters with a common set of tools.

To get it, gem install chef-metal. To hack, go to https://github.com/opscode/chef-metal. Currently supported provisioners include LXC containers, EC2, DigitalOcean, and Vagrant. If you just want to skip all that, follow the quick start in the README.

The current release is an alpha. You can see a lot of our plans, and some concrete examples, in the [requirements doc](https://github.com/opscode/chef-metal/blob/master/docs/r

knife ssh 'name:*' 'uptime' -G [email protected] -a private_ipaddress -x user
# to run chef-client on all servers:
knife ssh 'name:*' 'sudo chef-client' -G [email protected] -a private_ipaddress -x user
@double-z
double-z / cluster.rb
Last active August 29, 2015 14:26 — forked from mwrock/cluster.rb
chef-provisioning cluster provider
use_inline_resources
require 'json'
include ClcLibrary::Helper
include Provisioner::Helper
def whyrun_supported?
true
end
@double-z
double-z / ubuntu-1404-preseed
Created February 5, 2016 23:24 — forked from scottslowe/ubuntu-1404-preseed
This is a preseed file, written for Ubuntu Server 14.04.2, that provides a fully automated installation (assuming the presence of a PXE boot infrastructure and a local HTTP server to provide the installation files).
# Ubuntu Server automated installation
# by Scott Lowe ([email protected])
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i netcfg/choose_interface select eth0
d-i netcfg/get_hostname string hostname
d-i netcfg/get_domain string domain.com
d-i netcfg/wireless_wep string