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
| aj@AJ-Christensens-MacBook (branch: master) ~/Development/chef$ sudo irb | |
| >> require 'rubygems' | |
| => false | |
| >> Gem.available? "mixlib-cli" | |
| => false | |
| >> `gem install mixlib-cli` | |
| => "Successfully installed mixlib-cli-1.0.4\n1 gem installed\nInstalling ri documentation for mixlib-cli-1.0.4...\nInstalling RDoc documentation for mixlib-cli-1.0.4...\n" | |
| >> Gem.available? "mixlib-cli" | |
| => false | |
| >> Gem.refresh |
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
| <% if @node[:chef][:client_log] -%> | |
| log_location "<%= @node[:chef][:client_log] %> | |
| <% else -%> | |
| log_location STDOUT | |
| <% 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
| #!/usr/bin/ruby | |
| # Requirements | |
| require "csv" | |
| file = File.open("/tmp/play.dot","w") | |
| file.puts "graph G { " | |
| #file.puts "\trankdir=LR " | |
| file.puts "\tratio=expand;" |
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
| ase node[:platform] | |
| when "debian", "ubuntu" | |
| %w{automake autoconf libtool subversion-tools help2man build-essential erlang libicu38 libicu-dev libreadline5-dev checkinstall libmozjs-dev wget libcurl4-gnutls-dev}.each {|pkg| package(pkg) } | |
| end | |
| execute "download_couchdb" do | |
| user "root" | |
| cwd "/tmp" | |
| command "wget http://mirror.public-internet.co.uk/ftp/apache/couchdb/0.9.1/apache-couchdb-0.9.1.tar.gz" | |
| creates "/tmp/apache-couchdb-0.9.1.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
| try | |
| { | |
| DataTable dt = new DataTable(); | |
| if (d.ItemsSource is IEnumerable) | |
| { | |
| IEnumerable items = d.ItemsSource as IEnumerable; | |
| List<string> propertyNames = new List<string>(); | |
| foreach (object o in items) | |
| { |
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
| set.users({ | |
| :bob => { | |
| :gecos => "Brash Deploy User", | |
| :shell => "/bin/bash", | |
| :home => "/home/deploy" | |
| } | |
| } | |
| ) |
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
| queue_host "localhost" | |
| queue_password "" | |
| queue_port 61613 | |
| queue_retry_count 5 | |
| queue_retry_delay 5 | |
| queue_user "" | |
| queue_prefix 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
| def initialize(name, collection=nil, node=nil) | |
| super(name, collection, node) | |
| puts "Overridden initialize" | |
| @provider = Chef::Provider::Tomcat6Application | |
| end | |
| actions :create, :delete | |
| attribute :name, :kind_of => String, :name_attribute => true | |
| attribute :config_dir, :kind_of => String |
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
| users Mash.new unless attribute?("users") | |
| groups Mash.new unless attribute?("groups") | |
| ssh_keys Mash.new unless attribute?("ssh_keys") | |
| roles Mash.new unless attribute?("roles") | |
| groups[:admin] = {:gid => 113} | |
| roles[:chef] = {:groups => [:admin], :sudo_groups => [:admin]} | |
| roles[:staff] = {:groups => [:admin], :sudo_groups => [:admin]} |
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
| # Chef Client Config File | |
| # Automatically grabs configuration from ohai ec2 metadata. | |
| require 'ohai' | |
| require 'json' | |
| o = Ohai::System.new | |
| o.all_plugins | |
| chef_config = JSON.parse(o[:ec2][:userdata]) | |
| if chef_config.kind_of?(Array) |