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
| node = Spice::Node.show(name: n) | |
| node["run_list"] += ["recipe[#{name}]"] | |
| Spice::Node.update({name: n}.merge(node)) |
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 'mcollective' | |
| include MCollective::RPC | |
| mc = rpcclient("trebuchet") | |
| mc.status(:sha=>"asdjkshdajdkd", :project=>"octobutler", :branch=>"master") | |
| mc.install(:sha=>"asdjkshdajdkd", :project=>"octobutler", :branch=>"master") | |
| mc.disconnect |
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 "chef_handler" | |
| cookbook_file "#{node['chef_handler']['handler_path']}/mcollective_classlist.rb" do | |
| source "mcollective_classlist.rb" | |
| mode 0644 | |
| end | |
| chef_handler "MCollective::ClassList" do | |
| source "#{node['chef_handler']['handler_path']}/mcollective_classlist.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
| #!/bin/sh | |
| set -e | |
| if [ -z "$1" ]; then | |
| ruby-build --definitions | |
| exit 1 | |
| fi | |
| if [ -z "$2" ]; then | |
| rev=1 |
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 'active_support/time' | |
| bucket = Fog::Storage.new(:provider => 'AWS').directories.select {|d| d.key == 'my_bucket'} | |
| files = bucket.files.select {|f| f.content_length > 0 && | |
| f.key =~ %r{client-name.*\.zip}} | |
| expiration = Time.now.next_month.end_of_month | |
| signed_urls = files.map {|f| f.url(expiration)} | |
| fixed_signed_url = signed_urls.map do |su| | |
| su.sub(%r{s3\.(.*)/my_bucket}, "my_bucket.s3.#{$1}") | |
| 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
| require_recipe 'fog' | |
| route53_rr node[:ec2][:instance_id] do | |
| record_type "CNAME" | |
| fqdn "#{node[:ec2][:instance_id]}.#{node["route53"]["domain"]}" | |
| rdata(["#{node[:ec2][:public_hostname]}."]) | |
| accesskey node["route53"]["accesskey"] | |
| secretkey node["route53"]["secretkey"] | |
| zoneid node["route53"]["zoneid"] | |
| action :update |
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
| description "Noitd Monitoring Scout Server" | |
| start on filesystem | |
| stop on runlevel S | |
| respawn | |
| respawn limit 10 5 | |
| expect daemon | |
| oom never |
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 :github, :user => "root", :home => "/root", :group => "" do | |
| package "git-core" | |
| group = params[:group].empty? ? params[:user] : params[:group] | |
| directory "#{params[:home]}/.ssh" do | |
| mode "0700" | |
| owner params[:user] | |
| group group |
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
| r = gem_package "right_aws" do | |
| action :nothing | |
| end | |
| r.run_action(:install) | |
| require 'rubygems' | |
| Gem.clear_paths | |
| require 'right_aws' |
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 :npm, :user => "node", :home => "/srv/node" do | |
| file File.join(params[:home], ".npmrc") do | |
| content <<-EOH | |
| root = #{params[:home]}/.node_libraries | |
| binroot = #{params[:home]}/bin | |
| manroot = #{params[:home]}/share/man | |
| EOH | |
| owner params[:user] | |
| group params[:user] | |
| end |