On May 14, 2010, at 11:11 AM, Paul Choi wrote:That's good to know, thanks.
We want to be able to do something similar with Chef - the goal being,I'm doing this, so it is possible.
kickstart a host, then install Chef RPMs, then the host should just
automagically get configured according to its IP, hostname, or some kind of
identifying criteria. Any ideas on how to do this?
So far, the workflow that Chef expects is:This is what I do, except for the last part.
- install chef-client on node.
- chef-client auto-registers itself with either validation cert or password
- Use knife to apply role(s) to the newly created node
I have a separate piece of code that is driven by a data file that maps
virtual hosts onto virtual servers onto physical machines. The code sets up
the name servers, creates the machines through my hosting provider API and
sets up the roles for the servers in chef. You can actually create the nodes
before the client actually connects for the first time. The common key
between the virtual and the physical is the hostname of the machine. I know
what the machine name will be e.g 'webserver6' and the boot script names the
machine that before the chef client code is installed.
Since our servers are not in the cloud, it's actually good for us to tie stuff to host IP. The firewall allows access based on IP, and physical server specs are different based on their role.It's the manual application of role(s) to the newly created node that I would like to
see automated. I don't think there's a way in Chef to set a rule saying, "if a
host is in 10.1.12.* subnet, apply role[a], role[b], role[z], etc". If I can
figure out this last step, life would be just awesome. :)
You might be able to do this by writing some ruby code in a role file.....
I'm not sure how the chef client determines which cookbooks to download from
the server... it might be static.... others on the list can probably answer
this.
However, I'd have thought that basing roles on ip addresses is going to
remove some flexibility that you might need later on.
John
Archive powered by MHonArc 2.6.16.