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
| # | |
| # Cookbook Name:: delayed_job | |
| # Recipe:: default | |
| # | |
| node[:applications].each do |app_name, data| | |
| user = node[:users].first | |
| case node[:instance_role] | |
| when "solo", "app", "app_master" |
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
| include_recipe "git" | |
| node.run_state[:applications] = [] | |
| search(:apps) do |app| | |
| (app["server_roles"] & node.run_list.roles).each do |app_role| | |
| node.run_state[:applications] << {:app => app, :recipes => app["type"][app_role]} | |
| 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
| { | |
| "name": "webserver", | |
| "default_attributes": { | |
| "apache2": { | |
| "listen_ports": [ | |
| "8080", | |
| "443" | |
| ] | |
| } | |
| }, |
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
| 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
| 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
| { | |
| "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
| 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
| 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
| 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 |