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
plain_pass = Chef::EncryptedDataBagItem.load("aws-admin-passwords", "svc_goagent")["password"] | |
p plain_pass | |
#if unix box | |
if node['platform'] == 'ubuntu' | |
chef_gem "ruby-shadow" | |
package "whois" | |
unless node.attribute? "svc_goagent_pass" |
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
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
require 'guard/guard' | |
require 'mixlib/shellout' | |
module ::Guard | |
class Kitchen < ::Guard::Guard | |
def start | |
::Guard::UI.info("Guard::Kitchen is starting") |
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
default[::groups] = [ "foo","bar","baz" ] |
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 is a cookbook called <%= @cookbook_name %> |
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
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 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
bash "add multiverse source repository " do | |
user "root" | |
code "bash < <( sed -E 's/^#.*(deb.*multiverse)$/\\1/g' -i /etc/apt/sources.list )" | |
notifies :run, "execute[apt-get update]", :immediately | |
end | |
execute "apt-get update" do | |
action :nothing | |
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
# Author:: Adam Jacob <[email protected]> | |
# Author:: Joshua Timberman <[email protected]> | |
# | |
# Copyright 2009-2010, Opscode, Inc | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.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
define :email_alias, :recipients => [] do | |
execute "newaliases" do | |
action :nothing | |
end | |
t = nil | |
begin | |
t = resources(:template => "/etc/aliases") | |
rescue ArgumentError | |
t = template "/etc/aliases" do |
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
# Check this out, rvm use rbx | |
ruby_block "rvm use rbx" do | |
block do | |
Chef::Mixin::Command.popen4('bash -l -c "rvm use 1.9.1 && env"') do |p,i,o,e| | |
o.each_line do |line| | |
env_bits = line.split("=") | |
ENV[env_bits[0]] = env_bits[1] | |
end | |
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
# rsync/definition/rsync_target.rb | |
define :rsync_target, :path => nil, :comment => nil, :action => :set do | |
t = begin | |
resources(:template => "/etc/rsyncd.conf") | |
rescue | |
template "/etc/rsyncd.conf" do | |
owner "root" | |
group "root" | |
source "rsyncd.conf.erb" | |
cookbook "rsyncd" |
NewerOlder