Created
January 19, 2011 19:54
-
-
Save jayzes/786735 to your computer and use it in GitHub Desktop.
commands to bootstrap chef-client on ubuntu and osx
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
# Run with bash < <( curl https://gist.github.com/raw/786735/bootstrap-chef-client-osx.sh ) | |
# Switch to system Ruby | |
if [ -s "$HOME/.rvm/scripts/rvm" ]; then | |
rvm use system | |
fi | |
sudo gem install chef --no-ri --no-rdoc | |
sudo mkdir -p /etc/chef | |
sudo scp [email protected]:/etc/chef/validation.pem /etc/chef/validation.pem | |
sudo curl "https://gist.github.com/raw/786735/com.opscode.chef-client.plist" --O /Library/LaunchDaemons/com.opscode.chef-client.plist | |
sudo curl "https://gist.github.com/raw/786735/client.rb" --O /etc/chef/client.rb | |
sudo launchctl load -w /Library/LaunchDaemons/com.opscode.chef-client.plist |
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
# Run with bash < <( curl https://gist.github.com/raw/786735/bootstrap-chef-client-ubuntu.sh ) | |
echo 'deb http://apt.opscode.com/ lucid main' | sudo tee /etc/apt/sources.list.d/opscode.list | |
wget -qO - http://apt.opscode.com/[email protected] | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install chef -y | |
sudo scp [email protected]:/etc/chef/validation.pem /etc/chef/validation.pem | |
sudo chef-client |
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
# Configuration File For Chef (chef-client) | |
# | |
# The chef-client program will connect the local system to the specified | |
# server URLs through a RESTful API to retrieve its configuration. | |
# | |
# By default, the client is configured to connect to a Chef Server | |
# as prompted by DebConf during package installation. | |
# | |
# The chef-client daemon reads this file by default, as set in | |
# /etc/default/chef-client. | |
# | |
# This is a Ruby DSL config file, and can embed regular Ruby code in addition to | |
# the configuration settings. Some settings use Ruby symbols, which are a value | |
# that starts with a colon. In Ruby, anything but 'false' or 'nil' is true. To | |
# set something to false: | |
# | |
# some_setting false | |
# | |
# log_level specifies the level of verbosity for output. | |
# valid values are: :debug, :info, :warn, :error, :fatal. | |
# Corresponds to chef-client -l | |
log_level :info | |
# log_location specifies where the client should log to. | |
# valid values are: a quoted string specifying a file, or STDOUT with | |
# no quotes. STDOUT is a constant in Ruby. | |
# Corresponds to chef-client -L, and use -V with chef-client to ensure output | |
# also goes to STDOUT if this value is changed. The chef-client daemon is | |
# configured to log to /var/log/chef/client.log in /etc/default/chef-client. | |
log_location STDOUT | |
# ssl_verify_mode specifies if the REST client should verify SSL certificates. | |
# valid values are :verify_none, :verify_peer. The default Chef Server | |
# installation on Debian will use a self-generated SSL certificate so this | |
# should be :verify_none unless you replace the certificate. | |
ssl_verify_mode :verify_none | |
# chef_server_url specifies the Chef Server to connect to. | |
# valid values are any HTTP URL. | |
# Corresponds to chef-client -S | |
chef_server_url "http://chef.factorylabs.com:4000" | |
# file_cache_path specifies where the client should cache cookbooks, server | |
# cookie ID, and openid registration data. | |
# valid value is any filesystem directory location. | |
# file_cache_path "/var/cache/chef" | |
# file_backup_path specifies where chef will store backups of replaced files | |
# from template, cookbook_file and remote_file resources. | |
# file_backup_path "/var/lib/chef/backup" | |
# pid_file specifies the location of where chef-client daemon should keep the pid | |
# file. | |
# valid value is any filesystem file location. | |
# pid_file "/var/run/chef/client.pid" | |
# cache_options sets options used by the moneta library for local cache | |
# for checksums of compared objects. | |
# cache_options({ :path => "/var/cache/chef/checksums", :skip_expires => true}) | |
# signing_ca_user is used when generating the certificates used by chef to | |
# set the owner of the keyfile. This is set to chef so services that run | |
# as the chef user can read the file. | |
# signing_ca_user "chef" | |
# Mixlib::Log::Formatter.show_time specifies whether the log should | |
# contain timestamps. | |
# valid values are true or false. The printed timestamp is rfc2822, for example: | |
# Fri, 31 Jul 2009 19:19:46 -0600 | |
Mixlib::Log::Formatter.show_time = 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.opscode.chef-client</string> | |
<key>Program</key> | |
<string>/usr/bin/chef-client</string> | |
<key>StartInterval</key> | |
<integer>300</integer> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>UserName</key> | |
<string>root</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>--server=http://chef.factorylabs.com:4000</string> | |
</array> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment