Skip to content

Instantly share code, notes, and snippets.

@stephenlauck
Created January 29, 2013 23:38
Show Gist options
  • Save stephenlauck/4669064 to your computer and use it in GitHub Desktop.
Save stephenlauck/4669064 to your computer and use it in GitHub Desktop.
Migrate node across hosted chef servers
# update gems
sudo gem update --no-rdoc --no-ri
# edit client.rb with correct validation key and chef server
# also set the environment
log_level :info
log_location STDOUT
chef_server_url "https://api.opscode.com/organizations/modcloth-comments"
validation_client_name "modcloth-comments-validator"
node_name "comments-standalone-01.demo.modcloth.com"
# to
log_level :info
log_location STDOUT
chef_server_url "https://api.opscode.com/organizations/modcloth-platform"
validation_client_name "modcloth-platform-validator"
node_name "comments-test-01.demo.modcloth.com"
environment "demo"
# upload platform validation key from platform local
scp .chef/modcloth-platform-validator.pem <IP ADDRESS>:/home/s.lauck/validation.pem
# move platform validation key
sudo mv ~/validation.pem /etc/chef/
# delete client.pem
sudo rm /etc/chef/client.pem
# run client on node w/ first boot
chef-client -j /etc/chef/first-boot.json
# if user cookbook blows up converge
# log out and run client as a different user
# then re-login and run client as user
# DONE! check out `knife node list` on platform branch to see if it worked
# OR use the bootstrap method
# Migrate node to new chef server
# bundle exec knife bootstrap <IP ADDRESS> -N 'playland-test-01.demo.modcloth.com' -E demo -r "role[base]" -d migration -x <USERNAME> --sudo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment