Problem is that in my bare-bones vservers the servers come without a useful hostname/domainname setting.
Finally now everything works. I did:
- Create the vserver(s)
- Set up the vserver's DNS entries
- Copy my ssh id to the server(s):
scp ~/.ssh/id_dsa.pub root@1.1.1.1:/root/.ssh/authorized_keys - Create my base role (check out the quickstart)
- Add the hostname and resolv recipes of johntdyer https://github.com/johntdyer/hostname-chef https://github.com/johntdyer/resolv-chef (they have to be in you local repo as cookbooks/resolve and .../hostname). Upload them and add them to the base role's run-list
- DNS should be ready now, so:
knife bootstrap hostname.domain.de -E dev -N hostname.domain.de -r 'role[base]'
Decide if you need the environment setting (-E) - I find it damn useful. - NOW BEWARE, your nodes can now be found with
knife search "name:*" BUT
knife ssh "name:*" DOES NOT WORK. Maybe a bug: http://serverfault.com/questions/346418/knife-ssh-doesnt-find-my-nodes/346542#346542
The nodename init needs a chef-client run to propagate. So do:
knife ssh "name:**filter**" chef-client -E dev -a ipaddress -x root
Here pay attention to the ipaddress part. I would love to know how I should have discovered that the thing that is referred to as IP in knife search and other places is called ipaddress here... - Done. Check your nodes: knife search node "*:*"
The names should be corrected now.
If anybody knows the siblings to ipaddress and where that is documented please let me know. There's a question, too: http://serverfault.com/questions/400836/what-are-the-values-for-attributes-in-knife-ssh-a-ipaddress-etc
No comments:
Post a Comment