Chef Notes
When doing an amazon node, the hostname is set to an approximation of the IP address. You can specify your node name in client.rb.
node_name "new-name"
If you happened to have already ran chef-client, you can not rename your client but you can delete and recreate it. Do this as early as possible.
knife client delete WRONGNAME
rm /etc/chef/client.pem
# edit ~/chef-repo/client-config/client.rb
# add: node_name NEWNAME
sudo cp ~/chef-repo/client-config/* /etc/chef
chef-client
I got that information from Paul Dowman. He also has a cookbook called "chefonraiils" with a hostname recipe to set your hostname the same as your node name. I don't want the whole rails funcationality, so time to modify and make my first cookbook (sort of)
cd ~
git clone git://github.com/pauldowman/chefonrails.git
cd chef-repo
knife cookbook create sethostname
cd cookbooks/sethostname
cp ~/chefonrails/cookbooks/chefonrails/templates/default/hosts.erb templates/default
cp ~/chefonrails/cookbooks/chefonrails/recipes/hostname.rb recipes/default.rb
cd ~/chef-repo
knife cookbook upload sethostname
knife node run_list add awsubuntu1 'recipe[sethostname]'
# test
sudo chef-client
You can install cookbooks from github directly: stackoverflow.
user's cookbook: http://community.opscode.com/cookbooks/users
note: only applies users in the "sysadmins" group
knife cookbook site install users
knife cookbook upload users
knife data bag create users
export EDITOR=/usr/bin/vim
openssl passwd -1 "password" # gives you the has to put in a password entry
knife data bag edit users ytjohn
knife node run_list add awsubuntu1 'recipe[users::sysadmins]'
sudo chef-client
My amazon instance doesn't have Omnibus ruby and therefore, can't manage the shadow password. This failed silently for me.