Skip to content

Instantly share code, notes, and snippets.

View jtimberman's full-sized avatar
🚀

Joshua Timberman jtimberman

🚀
View GitHub Profile
%{portmap nfslock rpcbind}.each do |pkg|
package pkg do
action :upgrade
end
end
Host *
Protocol 2
ForwardAgent yes
TCPKeepAlive yes
ServerAliveInterval 240
PubkeyAuthentication yes
IdentityFile /home/username/.ssh/id_rsa
User username
resources in cookbook:
user "dnscache" do
uid 9997
case node[:platform]
when "ubuntu","debian"
gid "nogroup"
when "redhat", "centos"
gid "nobody"
else
execute "mysql-stop" do
command "/etc/init.d/mysql stop"
action :nothing
end
execute "mysql-start" do
command "/etc/init.d/mysql start"
action :nothing
end
/usr/lib/ruby/gems/1.8/gems/chef-server-0.5.4/lib/views/nodes/index.html.haml
- throw_content(:header, "Node List")
%table
- @node_list.each do |node|
%tr
%td
.node
%a{ :href => url(:node, { :id => node.gsub(/\./, "_") }) }
= node
%td
mount "/mnt/test" do
device "/dev/exportvg/testlv"
fstype "ext3"
action :mount
end
$ mount | grep testlv
/dev/mapper/exportvg-testlv on /mnt/test type ext3 (rw)
irb(main):001:0> File.stat("/dev/mapper/exportvg-testlv")
=> #<File::Stat dev=0xe, ino=2210485, mode=060660, nlink=1, uid=0, gid=6, rdev=0xfe03, size=0, blksize=4096, blocks=0, atime=Mon Feb 23 13:35:48 -0700 2009, mtime=Mon Feb 23 12:04:22 -0700 2009, ctime=Mon Feb 23 12:04:22 -0700 2009>
irb(main):002:0> File.stat("/dev/exportvg/testlv")
Errno::EACCES: Permission denied - /dev/exportvg/testlv
from (irb):2:in `stat'
from (irb):2
from :0
#!/bin/sh
#
# EC2 bootstrap
#
mkdir /etc/chef
mkdir /var/chef
cat > /etc/chef/solo.rb <<SOLO
cookbook_path "/var/chef/cookbooks"
[Fri, 06 Mar 2009 17:21:47 -0700] DEBUG: Processing remote_file[/usr/sbin/rebuild-iptables]
[Fri, 06 Mar 2009 17:21:47 -0700] DEBUG: remote_file[/usr/sbin/rebuild-iptables] using Chef::Provider::RemoteFile
[Fri, 06 Mar 2009 17:21:47 -0700] DEBUG: Checking remote_file[/usr/sbin/rebuild-iptables] for changes
[Fri, 06 Mar 2009 17:21:47 -0700] DEBUG: Downloading from server: cookbooks/iptables/files?id=rebuild-iptables&platform=ubuntu&version=8.10&fqdn=barkeep.int.housepub.org&checksum=eb1738315a85bb6b72c1c365f7e6e2a84f1a1a0a8d904bc8c199c828b7e0e97b
[Fri, 06 Mar 2009 17:21:47 -0700] DEBUG: Sending HTTP Request via GET to /cookbooks/iptables/files?id=rebuild-iptables&platform=ubuntu&version=8.10&fqdn=barkeep.int.housepub.org&checksum=eb1738315a85bb6b72c1c365f7e6e2a84f1a1a0a8d904bc8c199c828b7e0e97b
[Fri, 06 Mar 2009 17:21:47 -0700] DEBUG: /cookbooks/iptables/files?id=rebuild-iptables&platform=ubuntu&version=8.10&fqdn=barkeep.int.housepub.org&checksum=eb1738315a85bb6b72c1c365f7e6e2a84f1a1a0a8d904bc8c199c828b7e0
define :mysql_database, :action => 'create' do
def mysql(command, config=nil, )
"mysql --defaults-file=#{config} --execute=#{command.inspect}"
end
include_recipe "mysql::client"
# For now, use the super-user conf
case @node[:platform]
when "debian", "ubuntu"