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 | |
def find_deps(cookbook_dir) | |
nel = Hash.new { |h, k| h[k] = [] } | |
Dir.glob("#{cookbook_dir}/*/").each do |r| | |
deps_for(r, nel) | |
end | |
nel | |
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
$ grep 'node\[:network\]\[:interfaces\].' \#chef.log | |
10:15 < mkent_> node[:network][:interfaces][:eth1][:addresses] | |
22:24 <+Damm> msf, just pulling in the node[:network][:interfaces] attributes | |
20:44 < randybias> node[:network][:interfaces][:eth0][:addresses] | |
09:13 < sinBot> so fujin if I wanted to use that in an erb template, it'd be <%= @node[:network][:interfaces]["en1"]["addresses"].select{address}.flatten.to_str %> ? | |
12:27 < cwj> if i have an ipv4 ip address set on eth0, will it always be in @node[:network][:interfaces][:eth0][1] ? | |
02:19 < pluesch0r> however, i don't seem to be able to access @node[:network][:interfaces]... from inside the attributes file. | |
19:52 <@jtimberman> or node[:network][:interfaces][:eth0][:addresses][0] | |
20:09 < seryl> well, it's searchable. I'm trying the @node[:network][:interfaces][:eth0][:addresses][0] route, but getting blanks right now, playing around with it in chef solo | |
20:29 < kallistec> pp node[:network][:interfaces].current_attribute |
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
class Chef | |
class Provider | |
class RemoteS3File < Chef::Provider::RemoteFile | |
def load_current_resource | |
super | |
%w{bucket object_name aws_access_key_id aws_secret_access_key}.map do |attribute| | |
Chef::Application.fatal! "remote_s3_file: required attr: #{attribute} is nil", -92 if | |
@new_resource.send(attribute.to_sym).nil? | |
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
Vagrant::Config.run do |global_config| | |
aptdir = (ENV['APTCACHE'] or "#{ENV['HOME']}/aptcache/") | |
checkout = (ENV['COOKBOOKS'] or "#{ENV['HOME']}/openstack-cookbooks") | |
ip_prefix = (ENV['IP_PREFIX'] or "192.168.76.") | |
mac_prefix = (ENV['MAC_PREFIX'] or "080027076") | |
fixed = (ENV['FIXED'] or "10.0.76.0/24") | |
global_config.vm.define :chef do |config| | |
suffix = "100" | |
ip = "#{ip_prefix}#{suffix}" | |
config.vm.box = "base" |
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
;;; http-twiddle.el -- send & twiddle & resend HTTP requests | |
;; This program belongs to the public domain. | |
;; Author: Luke Gorrie <[email protected]> | |
;; Maintainer: Hasan Veldstra <[email protected]> | |
;; Created: 1 Feb 2006 | |
;; Adapted-By: Hasan Veldstra | |
;; Adapted-By: Christopher Brown <[email protected]> | |
;; Version: 1.0 |
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
# This might not work on newer (than 0.10.6) versions of Chef. | |
# Thanks for pointing to my new gist, spkane :) | |
# https://gist.github.com/1040543 | |
require 'rubygems' | |
require 'ohai' | |
o = Ohai::System.new() | |
o.all_plugins |
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 | |
cbdir=ARGV[0] | |
output = "./deps.dot" | |
puts "Running on #{cbdir}..." | |
cb_meta = Dir.glob("#{cbdir}/*/metadata.rb") | |
fp=File.open(output,"w") |
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 | |
cbdir=ARGV[0] | |
output = "./deps.dot" | |
puts "Running on #{cbdir}..." | |
cb_meta = Dir.glob("#{cbdir}/*/metadata.rb") | |
fp=File.open(output,"w") |
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
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] |
OlderNewer