Last active
August 29, 2015 14:11
-
-
Save tkuchiki/258faed0a9334d5721b5 to your computer and use it in GitHub Desktop.
setup chef-zero (ubuntu14.04)
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 'https://rubygems.org' | |
gem 'chef-zero', '3.2' |
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
export CHEF_DIR=/path/to/chef | |
apt-get install -y ruby ruby-dev | |
gem install bundle --no-ri --no-rdoc | |
bundle install --path=vendor/bundle | |
curl -L https://www.opscode.com/chef/install.sh | bash | |
bundle exec chef-zero | |
mkdir -p ${CHEF_DIR}/.chef | |
ssh-keygen -t rsa -N "" -f ${CHEF_DIR}/.chef/knife.pem | |
ssh-keygen -t rsa -N "" -f ${CHEF_DIR}/.chef/validation.pem | |
cat <<'EOF' > ${CHEF_DIR}/.chef/knife.rb | |
chef_conf_dir File.expand_path('..', __FILE__) | |
chef_root File.expand_path('../..', __FILE__) | |
log_level :info | |
log_location STDOUT | |
node_name 'knife' | |
cookbook_path File.expand_path('cookbooks', chef_root) | |
client_key File.expand_path('knife.pem', chef_conf_dir) | |
validation_client_name 'chef-validator' | |
validation_key File.expand_path('validation.pem', chef_conf_dir) | |
chef_server_url 'http://127.0.0.1:8889' | |
syntax_check_cache_path File.expand_path('syntax_check_cache', chef_conf_dir) | |
EOF | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment