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
| # This knife plugin provides the capability to set an attribute | |
| # value in a data bag item. By default the 'versions' data bag | |
| # is used, but that can be overridden with the -b option. | |
| # Copy this file to ~/.chef/plugins/knife to install the plugin. | |
| module KnifePlugins | |
| class DataBagVersionSet < Chef::Knife | |
| deps do | |
| require 'chef/data_bag' | |
| 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
| nagios_command "generic_queue_size" do | |
| command "/path/to/check_rabbitmq_queue_size.pl" | |
| arg_one {"queue_name" => String} | |
| arg_two {"warning_size" => Integer} | |
| arg_three {"critical_size" => Integer} | |
| end | |
| nagios_service "generic_queue_size" do | |
| nagios_command_generic_queue_size do | |
| queue_name "random_queue" |
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
| define :sudo_user, :username => nil do | |
| begin | |
| r = resource(:template => "/etc/sudoers") | |
| rescue | |
| r = template "/etc/sudoers" do | |
| source "sudoers.erb" | |
| attributes { :users => [], :groups => [] } | |
| end | |
| 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
| define :etc_service, :action => :restart do | |
| package "daemontools" do | |
| action :install | |
| end | |
| path = params[:path] ? params[:path] : ("/etc/service/" + params[:name]) | |
| log_path = params[:log_path] ? params[:log_path] : ("/var/log/multilog/" + params[:name]) | |
| if params[:action] == :delete | |
| directory path do | |
| action :delete | |
| recursive :true |
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
| ruby_block "config file" do | |
| block do | |
| run_context = Chef::RunContext.new(node, {}) | |
| r = Chef::Resource::File.new("#{node[:wordpress][:dir]}/wp-config.php", run_context) | |
| r.content(IO.read("#{node[:wordpress][:dir]}/wp-config-sample.php")) | |
| r.owner("root") | |
| r.group("root") | |
| r.mode("0644") | |
| r.run_action(:create) | |
| 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
| { | |
| "id": "my_app" | |
| "databases": { | |
| "production": { | |
| "encoding": "utf8", | |
| "adapter": "mysql", | |
| "username": "my_app", | |
| "database": "production", | |
| "password": "coolpassword" | |
| }, |
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
| name "base" | |
| description "Baseline configuration for all systems." | |
| run_list( | |
| "recipe[ohai]", | |
| "recipe[chef-client::delete_validation]", | |
| "recipe[chef-client]", | |
| "recipe[zsh]", | |
| "recipe[git]", | |
| "recipe[users]", |
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
| unless ARGV[0] && ARGV[1] | |
| puts "Usage: set_password.rb username password" | |
| exit 1 | |
| end | |
| require 'chef' | |
| require 'chef/config' | |
| require 'chef/webui_user' | |
| Chef::Config.from_file(File.expand_path("~/.chef/knife.rb")) |
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
| source 'http://rubygems.org' | |
| gem 'colored' | |
| gem 'escape' | |
| gem 'facets' | |
| gem 'extensions' | |
| gem 'quality_extensions' | |
| gem 'rscm' | |
| gem 'termios' | |
| gem 'net-ssh' |
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
| { | |
| "name": "webserver", | |
| "default_attributes": { | |
| "apache2": { | |
| "listen_ports": [ | |
| "8080", | |
| "443" | |
| ] | |
| } | |
| }, |