I wanted to try what you were suggesting. This was with CENTOS node (node6.whatever.com), which was NOT already registered in the Chef server.
On the node, I have /etc/chef/client.rb:
and validation.pem is in the same dir (/etc/chef).
I ran the command from my Chef workstation:
knife ssh ‘name:node6.whatever.com’ ‘sudo chef-client -o recipe[mycookbook::xx_server]’ -x root -P xxxxxxx
I got this error:
FATAL: No nodes returned from search!
Maybe I misunderstood what you said, or am missing something?
On Sun, 7/12/15, Noah Kantrowitz email@example.com wrote:
Subject: Re: [chef] “Just” register a Chef node ?
Date: Sunday, July 12, 2015, 12:17 PM
Jul 12, 2015, at 9:09 AM, o haya firstname.lastname@example.org
Assuming the machine
the Chef client software installed
Has client.pem removed
- Has client.rb
with “node_name” being empty
Does Chef provide a way/tool to
remotely cause that machine to be registered as a Chef node
(initiated from a centralized machine)?
This would be for both Windows-based
and Linux (CENTOS-/Redhat-) based machines.
I know that we can
do “knife bootstrap”, but in our case, we
don’t want to push the Chef client software to the node
machines, but rather want to pre-provision the node machines
with the Chef client software and just be able to cause the
node machines to register as Chef nodes. Something like
having a “knife bootstrap”, but where the
bootstrap process would not include pushing the Chef client
software to the node machine(s), would be perfect.
Knife bootstrap is already
idempotent, if chef-client is present on the machine it will
not reinstall it. If you are working with something like an
autoscaling, you can use the validator key bootstraps. Get
the key for your org’s validator client and put it in
something like /etc/chef/validator.pem, and set the
validator key path and client name in your client.rb when
you bake your images. The first time chef-client runs it
will use this to register with the server automatically.