Chef-client auto-registered run_list


#1

Aloha,

I’m looking into, but I do not find the correct way (if there is any) to
change the default run list that nodes use.

I know I can add nodes with knife and at the same time assign them a run
list, but when clients are auto-registered (via chef-validator), the run
list is always empty by default.

I would like if there exist a way to do this without hardcoding it
somewhere deep in server’s code :]

Thank you very much in advance.


Roberto C. Morano
Área de Proyectos

Emergya Consultoría.
Tlf: +34 954 51 75 77
Fax: +34 954 51 64 73
http://www.emergya.es


#2

On Thu, Dec 22, 2011 at 5:49 AM, Roberto C. Morano rcmorano@emergya.com wrote:

Aloha,

I’m looking into, but I do not find the correct way (if there is any) to
change the default run list that nodes use.

I know I can add nodes with knife and at the same time assign them a run
list, but when clients are auto-registered (via chef-validator), the run
list is always empty by default.

I would like if there exist a way to do this without hardcoding it somewhere
deep in server’s code :]

Thank you very much in advance.

You can set a node’s run list by putting it in a json file and running
it with chef-client on the node. See
http://wiki.opscode.com/display/chef/Setting+the+run_list+in+JSON+during+run+time.
Note that if the run fails for any reason the run list is not saved as
of 0.10.

-Eric


#3

The client is different than the node.

The client, which gets registered with the validation certificate is the thing that authenticates to the chef server API.

The node is what represents the configuration and information about a specific system in your infrastructure.

Generally a node has its own client, but they are separate objects on the chef server.

On Dec 22, 2011, at 6:49, “Roberto C. Morano” rcmorano@emergya.com wrote:

Aloha,

I’m looking into, but I do not find the correct way (if there is any) to change the default run list that nodes use.

I know I can add nodes with knife and at the same time assign them a run list, but when clients are auto-registered (via chef-validator), the run list is always empty by default.

I would like if there exist a way to do this without hardcoding it somewhere deep in server’s code :]

Thank you very much in advance.


Roberto C. Morano
Área de Proyectos

Emergya Consultoría.
Tlf: +34 954 51 75 77
Fax: +34 954 51 64 73
http://www.emergya.es


#4

El 23/12/11 06:03, Joshua Timberman escribió:

The client is different than the node.

The client, which gets registered with the validation certificate is the thing that authenticates to the chef server API.

The node is what represents the configuration and information about a specific system in your infrastructure.

Generally a node has its own client, but they are separate objects on the chef server.

I know. When I said “clients are auto-registered” I meant node
auto-registered aswell :]

Thanks!

On Dec 22, 2011, at 6:49, "Roberto C. Morano"rcmorano@emergya.com wrote:

Aloha,

I’m looking into, but I do not find the correct way (if there is any) to change the default run list that nodes use.

I know I can add nodes with knife and at the same time assign them a run list, but when clients are auto-registered (via chef-validator), the run list is always empty by default.

I would like if there exist a way to do this without hardcoding it somewhere deep in server’s code :]

Thank you very much in advance.


Roberto C. Morano
Área de Proyectos

Emergya Consultoría.
Tlf: +34 954 51 75 77
Fax: +34 954 51 64 73
http://www.emergya.es


Roberto C. Morano
Área de Proyectos

Emergya Consultoría.
Tlf: +34 954 51 75 77
Fax: +34 954 51 64 73
http://www.emergya.es


#5

El 22/12/11 21:21, Eric Heydrick escribió:

On Thu, Dec 22, 2011 at 5:49 AM, Roberto C. Moranorcmorano@emergya.com wrote:

Aloha,

I’m looking into, but I do not find the correct way (if there is any) to
change the default run list that nodes use.

I know I can add nodes with knife and at the same time assign them a run
list, but when clients are auto-registered (via chef-validator), the run
list is always empty by default.

I would like if there exist a way to do this without hardcoding it somewhere
deep in server’s code :]

Thank you very much in advance.
You can set a node’s run list by putting it in a json file and running
it with chef-client on the node. See
http://wiki.opscode.com/display/chef/Setting+the+run_list+in+JSON+during+run+time.
Note that if the run fails for any reason the run list is not saved as
of 0.10.

It could be a good idea, but I’m looking for a way to do it from the server.
I mean, that way I would have to modify my nodes’ chef-client config
every time I’d like to add something new to the "default run list"
instead of just having it automatically replicated on every new node.
This seems pretty unmaintenable for me.

I’m thinking about running “chef-client -j” to add a default run list
with only one recipe that retrieve the real “default run list” from, for
example, a databag in the server.
It still sounds hacky to me, but at least I wouldn’t have to modify my
nodes’ chef-client config every time manually, just once.

I think I’ll look into chef-server’s code to see if I can “plug” the
default run list somewhere.

-Eric

Thanks for your idea Eric :]


Roberto C. Morano
Área de Proyectos

Emergya Consultoría.
Tlf: +34 954 51 75 77
Fax: +34 954 51 64 73
http://www.emergya.es


#6

On Fri, Dec 23, 2011 at 6:37 AM, Roberto C. Morano rcmorano@emergya.com wrote:

It could be a good idea, but I’m looking for a way to do it from the server.
I mean, that way I would have to modify my nodes’ chef-client config every
time I’d like to add something new to the “default run list” instead of just
having it automatically replicated on every new node. This seems pretty
unmaintenable for me.

I would put the run_list in a role, and put all the nodes in that role
when they’re created.

Then you can centrally manage the role.

I’m thinking about running “chef-client -j” to add a default run list with
only one recipe that retrieve the real “default run list” from, for example,
a databag in the server.
It still sounds hacky to me, but at least I wouldn’t have to modify my
nodes’ chef-client config every time manually, just once.

You could probably manage that json file as a cookbook_file or databag
driven template. The next client run should pick it up. Ergh.

Bryan


#7

El 23/12/11 19:56, Bryan McLellan escribió:

On Fri, Dec 23, 2011 at 6:37 AM, Roberto C. Moranorcmorano@emergya.com wrote:

It could be a good idea, but I’m looking for a way to do it from the server.
I mean, that way I would have to modify my nodes’ chef-client config every
time I’d like to add something new to the “default run list” instead of just
having it automatically replicated on every new node. This seems pretty
unmaintenable for me.
I would put the run_list in a role, and put all the nodes in that role
when they’re created.

Then you can centrally manage the role.

Right, that makes much more sense than what I said. I don’t know what I
was thinking :]

Thank you Bryan!

I’m thinking about running “chef-client -j” to add a default run list with
only one recipe that retrieve the real “default run list” from, for example,
a databag in the server.
It still sounds hacky to me, but at least I wouldn’t have to modify my
nodes’ chef-client config every time manually, just once.
You could probably manage that json file as a cookbook_file or databag
driven template. The next client run should pick it up. Ergh.

Bryan


Roberto C. Morano
Área de Proyectos

Emergya Consultoría.
Tlf: +34 954 51 75 77
Fax: +34 954 51 64 73
http://www.emergya.es