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
| ddeleo@boltzmann chef git:(master)> bin/knife role tree $node_name | |
| top level | |
| |-role[preprod] | |
| | |-recipe[network] | |
| | |-recipe[splunk42] | |
| |-role[mysql-master] | |
| | |-role[base] | |
| | | |-role[platform-annoyances] | |
| | | | |-recipe[platform-specific] | |
| | | | |-recipe[selinux::disabled] |
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 | |
| recipe_path = ARGV[0] | |
| if recipe_path.nil? | |
| STDERR.puts "usage: chef-apply RECIPE_FILE" | |
| exit 1 | |
| end | |
| recipe_path = File.expand_path(recipe_path) |
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
| # (sudo) knife exec -c /etc/chef/client.rb resource_display.rb [FILTER] | |
| # This will update the recipes and such on your machine, but it shouldn't make any real changes. | |
| # Coded in 10 minutes, use at your own risk. | |
| require 'chef/client' | |
| require 'chef/checksum_cache' | |
| require 'chef/provider' | |
| require 'chef/providers' | |
| require 'chef/resource' | |
| require 'chef/resources' |
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 'pp' | |
| require 'fileutils' | |
| require 'rubygems' | |
| # ==HAX WARNINGS: | |
| # * this does some terrible things, like using a regex to prevent rubygems from | |
| # loading at all. This will be made non-terrible in the future. | |
| # * Dependency resolution is amateur hour. This will also be made non terrible | |
| # in the future. | |
| # ==Philosopy |
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 | |
| #= k | |
| #== Requirements | |
| # I install Chef with rubygems. May/may not work with other install methods. | |
| # | |
| #== INSTALL | |
| # copy this to ~/bin/k | |
| # | |
| #== USE |
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
| # recipe A | |
| template "authorized_keys" do | |
| variables :two_factor => false, :foo => "bar" | |
| # other stuff | |
| end | |
| # 2 factor auth recipe | |
| template "authorized_keys" do | |
| variables(Hash.new) if variables.nil? |
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
| link "/tmp/foo" do | |
| to "/tmp/bar" | |
| end | |
| log "this is a message" do | |
| action :nothing | |
| end | |
| link_resource = resources(:link => "/tmp/foo") |
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
| gem_package("some-gem") do | |
| action(:nothing) | |
| run_action(:install) | |
| end | |
| Gem.clear_paths | |
| require 'some-gem' |
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 'benchmark' | |
| require 'optparse' | |
| require 'pp' | |
| require 'rubygems' | |
| require 'yajl' | |
| require 'chef/rest' | |
| module CGrep | |
| class Config |
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 'pp' | |
| require 'thread' | |
| class Result < Queue | |
| def to_a | |
| @que | |
| end | |
| end | |
| class Titerator |