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
ruby_block "reload config" do | |
block do | |
Chef::Config.from_file("/etc/chef/client.rb") | |
end | |
action :nothing | |
end | |
template "/etc/chef/client.rb" do | |
... | |
notifies :run, resources(:ruby_block => "reload config") |
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
# | |
# Tasks to keep your repository in sync with your Chef Server | |
# | |
# Author:: Matthew Kent (<[email protected]>) | |
# Copyright:: Copyright (c) 2010 Matthew Kent | |
# License:: Apache License, Version 2.0 | |
# | |
# 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
require 'rubygems' | |
require 'chef' | |
require 'fog' | |
require 'google_spreadsheet' | |
Chef::Config.from_file("~/.chef/knife.rb") | |
ec2 = Fog::AWS::EC2.new(:aws_access_key_id => ENV["AWS_KEY"], | |
:aws_secret_access_key => ENV["AWS_SECRET"] ) |
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 | |
require 'rubygems' | |
require 'chef' | |
require 'chef/client' | |
require 'chef/run_context' | |
Chef::Config[:solo] = true | |
Chef::Config[:log_level] = :info | |
Chef::Log.level(:info) |
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
" Vim indent file | |
" Language: CSS | |
" Maintainer: Nikolai Weibull <[email protected]> | |
" Latest Revision: 2010-12-22 | |
if exists("b:did_indent") | |
finish | |
endif | |
let b:did_indent = 1 |
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/ruby | |
require 'chef/config' | |
require 'chef/search/query' | |
require 'chef/log' | |
require 'time' | |
require 'getoptlong' | |
require "ohai" | |
RET = { |
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
def initialize(*args) | |
super if defined?(super) | |
@action = "deploy" | |
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
sudo apt-get install libssl-dev | |
sudo gem install fpm | |
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | |
tar -zxvf ruby-1.9.3-p392.tar.gz | |
cd src/ruby-1.9.3-p392 | |
time (./configure --prefix=/usr && make && make install DESTDIR=/tmp/installdir) | |
fpm -s dir -t deb -n ruby -v 1.9.3-p392 -C /tmp/installdir \ | |
-p ruby-VERSION_ARCH.deb -d "libstdc++6 (>= 4.4.3)" \ |
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
include Chef::Mixin::Command | |
action :create do | |
size = new_resource.size | |
volumes = new_resource.volumes.times.map{|i| (i == 0 ? "/dev/sdf" : "/dev/sdf#{i}") } | |
setra = new_resource.blockdev_setra | |
volume_group = new_resource.volume_group | |
logical_volume = new_resource.name | |
mdadm_device = new_resource.mdadm_device | |
mount_point = new_resource.mount_point |
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 | |
# | |
config = File.join(File.dirname(__FILE__), '..', '.chef', 'knife.rb') | |
Chef::Config.from_file(config) | |
load_gem_or_report(%w{aws}) | |
desc 'Delete any ec2-based chef nodes that no longer exist' | |
task :cleanup_nodes do |
OlderNewer