Newb question about bootstrap client (with knife bootstrap)

Hi

I’ve installed a local chef server (0.9.12), and then I’ve tried to bootstrap a client using:

sudo knife bootstrap comp1u.localdomain -x user -P somepassword --sudo -s http://chefserv.localdomain:4000/

Everything went OK, except that it didn’t install init scripts for chef-client. I’ve looked at the chef::bootstrap_client cookbook, and It seems to me that runit should be installed and running. Am i wrong?

I’m attaching the output of the bootstrap command, but I don’t see any errors there.

Haim,
The knife bootstrap subcommand does not enable any sort of init
script. If you would like this behavior please add the
chef::bootstrap_client recipe to your nodes run list (preferably in
some sort of base role).

More info about knife boostrap and the chef cookbook can be found here:
http://wiki.opscode.com/display/chef/Knife+Bootstrap
https://github.com/opscode/cookbooks/tree/master/chef

Seth

--
Opscode, Inc.
Seth Chisamore, Technical Evangelist
T: (404) 348-0505 E: schisamo@opscode.com
Twitter, IRC, Github: schisamo

On Tue, Nov 30, 2010 at 6:57 AM, Haim Ashkenazi
haim.ashkenazi@gmail.com wrote:

Hi

I've installed a local chef server (0.9.12), and then I've tried to bootstrap a client using:

sudo knife bootstrap comp1u.localdomain -x user -P somepassword --sudo -s http://chefserv.localdomain:4000/

Everything went OK, except that it didn't install init scripts for chef-client. I've looked at the chef::bootstrap_client cookbook, and It seems to me that runit should be installed and running. Am i wrong?

I'm attaching the output of the bootstrap command, but I don't see any errors there.

Any ideas?

Thanks in advance

Haim Ashkenazi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Seth,

On Nov 30, 2010, at 2:09 PM, Seth Chisamore wrote:

Haim,
The knife bootstrap subcommand does not enable any sort of init
script. If you would like this behavior please add the
chef::bootstrap_client recipe to your nodes run list (preferably in
some sort of base role).
Oh, I thought that it was running it. OK, thanks.

Thanks

Haim

More info about knife boostrap and the chef cookbook can be found here:
http://wiki.opscode.com/display/chef/Knife+Bootstrap
https://github.com/opscode/cookbooks/tree/master/chef

Seth

--
Opscode, Inc.
Seth Chisamore, Technical Evangelist
T: (404) 348-0505 E: schisamo@opscode.com
Twitter, IRC, Github: schisamo

On Tue, Nov 30, 2010 at 6:57 AM, Haim Ashkenazi
haim.ashkenazi@gmail.com wrote:

Hi

I've installed a local chef server (0.9.12), and then I've tried to bootstrap a client using:

sudo knife bootstrap comp1u.localdomain -x user -P somepassword --sudo -s http://chefserv.localdomain:4000/

Everything went OK, except that it didn't install init scripts for chef-client. I've looked at the chef::bootstrap_client cookbook, and It seems to me that runit should be installed and running. Am i wrong?

I'm attaching the output of the bootstrap command, but I don't see any errors there.

Any ideas?

Thanks in advance

Haim Ashkenazi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkz1AMsACgkQhwMtGgRKzT017ACgj5Z/y54Dcw3qG7MHRM0i8zSY
Y2gAn325Y/1E/SApmW51Y4GjW8JCg5fF
=XA9x
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

On Nov 30, 2010, at 5:09 AM, Seth Chisamore wrote:

The knife bootstrap subcommand does not enable any sort of init
script. If you would like this behavior please add the
chef::bootstrap_client recipe to your nodes run list (preferably in
some sort of base role).

I recently updated the Chef cookbook (version 0.22.0) to have a new recipe called 'client_service' that will only set up the desired service style - init_style (runit, init script, daemontools, or bluepill). The bootstrap_client also drops off the config file /etc/chef/client.rb, but when using the bootstrap subcommand for knife, or ec2 server create, it will already have the config file set up.

Cheers!


Opscode, Inc
Joshua Timberman, Technical Evangelist
IRC, Skype, Twitter, Github: jtimberman

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkz1GugACgkQO97WSdVpzT2L9QCeOJC1/jNnmUpnQxORmWV+sCQf
1yAAn03nO+I06jpyZVfBiaR1BuDLDUz6
=RoNt
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Thanks, I'll try to run chef::client_service after install and see if it works.

Bye

On Nov 30, 2010, at 5:40 PM, Joshua Timberman wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

On Nov 30, 2010, at 5:09 AM, Seth Chisamore wrote:

The knife bootstrap subcommand does not enable any sort of init
script. If you would like this behavior please add the
chef::bootstrap_client recipe to your nodes run list (preferably in
some sort of base role).

I recently updated the Chef cookbook (version 0.22.0) to have a new recipe called 'client_service' that will only set up the desired service style - init_style (runit, init script, daemontools, or bluepill). The bootstrap_client also drops off the config file /etc/chef/client.rb, but when using the bootstrap subcommand for knife, or ec2 server create, it will already have the config file set up.

Cheers!


Opscode, Inc
Joshua Timberman, Technical Evangelist
IRC, Skype, Twitter, Github: jtimberman

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkz1GugACgkQO97WSdVpzT2L9QCeOJC1/jNnmUpnQxORmWV+sCQf
1yAAn03nO+I06jpyZVfBiaR1BuDLDUz6
=RoNt
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkz1N/cACgkQhwMtGgRKzT16tgCcDzxZiov0RsMILnRFso2mUJ6a
7NIAniI/jUK91IerqxzdX9R9e48N4ziD
=GrBy
-----END PGP SIGNATURE-----

I'm using the client_service recipe suggested, and it does install the
chef-client as a daemon. HOWEVER, it will rewrite your /etc/chef/
client.rb file periodically (as advertised). I like to give my nodes
UUID's for their node name, however the template which comes with the
chef cookbook does not supply a node_name.

I tried adding this to the template, but the property comes up blank
when the erb is interpreted.

node_name "<%= node[:name] %>"

Am I looking for the correct property/symbol? Using knife node show NODE -a name shows me that I'm barking up the wrong tree.

{
"name": null
}

However, the full output of knife node show NODE contains this -

{
"normal": {
"tags": [

 ]

},
{
"normal": {
"tags": [

 ]

},
"name": "8C770152-9F3A-400B-8C57-9646FE7ED28C",
"override": {
},
...
}

Here is how I called bootstrap in this "instance" -

knife bootstrap ec2-xyz.amazonaws.com --node-name uuidgen --
log_level info --ssh-user root --run-list "role[mta]"

-jesse

On Nov 30, 2010, at 12:44 PM, Haim Ashkenazi wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Thanks, I'll try to run chef::client_service after install and see
if it works.

Bye

On Nov 30, 2010, at 5:40 PM, Joshua Timberman wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

On Nov 30, 2010, at 5:09 AM, Seth Chisamore wrote:

The knife bootstrap subcommand does not enable any sort of init
script. If you would like this behavior please add the
chef::bootstrap_client recipe to your nodes run list (preferably in
some sort of base role).

I recently updated the Chef cookbook (version 0.22.0) to have a new
recipe called 'client_service' that will only set up the desired
service style - init_style (runit, init script, daemontools, or
bluepill). The bootstrap_client also drops off the config file /etc/
chef/client.rb, but when using the bootstrap subcommand for knife,
or ec2 server create, it will already have the config file set up.

Cheers!


Opscode, Inc
Joshua Timberman, Technical Evangelist
IRC, Skype, Twitter, Github: jtimberman

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkz1GugACgkQO97WSdVpzT2L9QCeOJC1/jNnmUpnQxORmWV+sCQf
1yAAn03nO+I06jpyZVfBiaR1BuDLDUz6
=RoNt
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkz1N/cACgkQhwMtGgRKzT16tgCcDzxZiov0RsMILnRFso2mUJ6a
7NIAniI/jUK91IerqxzdX9R9e48N4ziD
=GrBy
-----END PGP SIGNATURE-----

Hi Jesse,

On Nov 30, 2010, at 10:02 PM, Jesse Callaway wrote:

I'm using the client_service recipe suggested, and it does install the chef-client as a daemon. HOWEVER, it will rewrite your /etc/chef/client.rb file periodically (as advertised). I like to give my nodes UUID's for their node name, however the template which comes with the chef cookbook does not supply a node_name.
I've looked at the recipe and it seems that it only changes /etc/chef/client.rb in case you're using init as init_style. When using runit I can't find somewhere where it overwrites chef's conf file. Am I wrong?

Bye

I tried adding this to the template, but the property comes up blank when the erb is interpreted.

node_name "<%= node[:name] %>"

Am I looking for the correct property/symbol? Using knife node show NODE -a name shows me that I'm barking up the wrong tree.

{
"name": null
}

However, the full output of knife node show NODE contains this -

{
"normal": {
"tags": [

]
},
{
"normal": {
"tags": [

]
},
"name": "8C770152-9F3A-400B-8C57-9646FE7ED28C",
"override": {
},
...
}

Here is how I called bootstrap in this "instance" -

knife bootstrap ec2-xyz.amazonaws.com --node-name uuidgen --log_level info --ssh-user root --run-list "role[mta]"

-jesse

On Nov 30, 2010, at 12:44 PM, Haim Ashkenazi wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Thanks, I'll try to run chef::client_service after install and see if it works.

Bye

On Nov 30, 2010, at 5:40 PM, Joshua Timberman wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

On Nov 30, 2010, at 5:09 AM, Seth Chisamore wrote:

The knife bootstrap subcommand does not enable any sort of init
script. If you would like this behavior please add the
chef::bootstrap_client recipe to your nodes run list (preferably in
some sort of base role).

I recently updated the Chef cookbook (version 0.22.0) to have a new recipe called 'client_service' that will only set up the desired service style - init_style (runit, init script, daemontools, or bluepill). The bootstrap_client also drops off the config file /etc/chef/client.rb, but when using the bootstrap subcommand for knife, or ec2 server create, it will already have the config file set up.

Cheers!


Opscode, Inc
Joshua Timberman, Technical Evangelist
IRC, Skype, Twitter, Github: jtimberman

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkz1GugACgkQO97WSdVpzT2L9QCeOJC1/jNnmUpnQxORmWV+sCQf
1yAAn03nO+I06jpyZVfBiaR1BuDLDUz6
=RoNt
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkz1N/cACgkQhwMtGgRKzT16tgCcDzxZiov0RsMILnRFso2mUJ6a
7NIAniI/jUK91IerqxzdX9R9e48N4ziD
=GrBy
-----END PGP SIGNATURE-----

I probably should have posed this question on a separate thread, sorry
for the confusion.

there are 2 recipes which will write out an /etc/chef/client.rb

One is bootstrap_client.rb, and the other is client.rb. Neither one
really bothers much with the init style. You are referring to code in
client_service.rb, which does not touch the config file.

-jesse

On Nov 30, 2010, at 3:58 PM, Haim Ashkenazi wrote:

Hi Jesse,

On Nov 30, 2010, at 10:02 PM, Jesse Callaway wrote:

I'm using the client_service recipe suggested, and it does install
the chef-client as a daemon. HOWEVER, it will rewrite your /etc/
chef/client.rb file periodically (as advertised). I like to give my
nodes UUID's for their node name, however the template which comes
with the chef cookbook does not supply a node_name.
I've looked at the recipe and it seems that it only changes /etc/
chef/client.rb in case you're using init as init_style. When using
runit I can't find somewhere where it overwrites chef's conf file.
Am I wrong?

Bye

I tried adding this to the template, but the property comes up
blank when the erb is interpreted.

node_name "<%= node[:name] %>"

Am I looking for the correct property/symbol? Using knife node show NODE -a name shows me that I'm barking up the wrong tree.

{
"name": null
}

However, the full output of knife node show NODE contains this -

{
"normal": {
"tags": [

]
},
{
"normal": {
"tags": [

]
},
"name": "8C770152-9F3A-400B-8C57-9646FE7ED28C",
"override": {
},
...
}

Here is how I called bootstrap in this "instance" -

knife bootstrap ec2-xyz.amazonaws.com --node-name uuidgen --
log_level info --ssh-user root --run-list "role[mta]"

-jesse

On Nov 30, 2010, at 12:44 PM, Haim Ashkenazi wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Thanks, I'll try to run chef::client_service after install and see
if it works.

Bye

On Nov 30, 2010, at 5:40 PM, Joshua Timberman wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

On Nov 30, 2010, at 5:09 AM, Seth Chisamore wrote:

The knife bootstrap subcommand does not enable any sort of init
script. If you would like this behavior please add the
chef::bootstrap_client recipe to your nodes run list (preferably
in
some sort of base role).

I recently updated the Chef cookbook (version 0.22.0) to have a
new recipe called 'client_service' that will only set up the
desired service style - init_style (runit, init script,
daemontools, or bluepill). The bootstrap_client also drops off
the config file /etc/chef/client.rb, but when using the bootstrap
subcommand for knife, or ec2 server create, it will already have
the config file set up.

Cheers!


Opscode, Inc
Joshua Timberman, Technical Evangelist
IRC, Skype, Twitter, Github: jtimberman

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkz1GugACgkQO97WSdVpzT2L9QCeOJC1/jNnmUpnQxORmWV+sCQf
1yAAn03nO+I06jpyZVfBiaR1BuDLDUz6
=RoNt
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkz1N/cACgkQhwMtGgRKzT16tgCcDzxZiov0RsMILnRFso2mUJ6a
7NIAniI/jUK91IerqxzdX9R9e48N4ziD
=GrBy
-----END PGP SIGNATURE-----

I figured out a workaround. Looking in the rdocs for chef I found a
name() method in the Node class. So the template now has

node_name "<%= node.name() %>"

So this allows nodes which are not registered by their fqdn to have
the chef::client_service recipe in their run list.

What was wrong with the syntax of node[:name]? I'm still learning!

-jesse

On Nov 30, 2010, at 4:11 PM, Jesse Callaway wrote:

I probably should have posed this question on a separate thread,
sorry for the confusion.

there are 2 recipes which will write out an /etc/chef/client.rb

One is bootstrap_client.rb, and the other is client.rb. Neither one
really bothers much with the init style. You are referring to code
in client_service.rb, which does not touch the config file.

-jesse

On Nov 30, 2010, at 3:58 PM, Haim Ashkenazi wrote:

Hi Jesse,

On Nov 30, 2010, at 10:02 PM, Jesse Callaway wrote:

I'm using the client_service recipe suggested, and it does install
the chef-client as a daemon. HOWEVER, it will rewrite your /etc/
chef/client.rb file periodically (as advertised). I like to give
my nodes UUID's for their node name, however the template which
comes with the chef cookbook does not supply a node_name.
I've looked at the recipe and it seems that it only changes /etc/
chef/client.rb in case you're using init as init_style. When using
runit I can't find somewhere where it overwrites chef's conf file.
Am I wrong?

Bye

I tried adding this to the template, but the property comes up
blank when the erb is interpreted.

node_name "<%= node[:name] %>"

Am I looking for the correct property/symbol? Using knife node show NODE -a name shows me that I'm barking up the wrong tree.

{
"name": null
}

However, the full output of knife node show NODE contains this -

{
"normal": {
"tags": [

]
},
{
"normal": {
"tags": [

]
},
"name": "8C770152-9F3A-400B-8C57-9646FE7ED28C",
"override": {
},
...
}

Here is how I called bootstrap in this "instance" -

knife bootstrap ec2-xyz.amazonaws.com --node-name uuidgen --
log_level info --ssh-user root --run-list "role[mta]"

-jesse

On Nov 30, 2010, at 12:44 PM, Haim Ashkenazi wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Thanks, I'll try to run chef::client_service after install and
see if it works.

Bye

On Nov 30, 2010, at 5:40 PM, Joshua Timberman wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

On Nov 30, 2010, at 5:09 AM, Seth Chisamore wrote:

The knife bootstrap subcommand does not enable any sort of init
script. If you would like this behavior please add the
chef::bootstrap_client recipe to your nodes run list
(preferably in
some sort of base role).

I recently updated the Chef cookbook (version 0.22.0) to have a
new recipe called 'client_service' that will only set up the
desired service style - init_style (runit, init script,
daemontools, or bluepill). The bootstrap_client also drops off
the config file /etc/chef/client.rb, but when using the
bootstrap subcommand for knife, or ec2 server create, it will
already have the config file set up.

Cheers!


Opscode, Inc
Joshua Timberman, Technical Evangelist
IRC, Skype, Twitter, Github: jtimberman

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkz1GugACgkQO97WSdVpzT2L9QCeOJC1/jNnmUpnQxORmWV+sCQf
1yAAn03nO+I06jpyZVfBiaR1BuDLDUz6
=RoNt
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkz1N/cACgkQhwMtGgRKzT16tgCcDzxZiov0RsMILnRFso2mUJ6a
7NIAniI/jUK91IerqxzdX9R9e48N4ziD
=GrBy
-----END PGP SIGNATURE-----

On Tue, Nov 30, 2010 at 7:18 PM, Jesse Callaway jcallaway@limelabs.com wrote:

I figured out a workaround. Looking in the rdocs for chef I found a name()
method in the Node class. So the template now has

node_name "<%= node.name() %>"

So this allows nodes which are not registered by their fqdn to have the
chef::client_service recipe in their run list.

What was wrong with the syntax of node[:name]? I'm still learning!

The node name isn't an attribute the way that attributes set by ohai
or your recipes are, so you can't access it in the same way.

-jesse

Dan DeLeo

On Dec 2, 2010, at 11:56 AM, Daniel DeLeo wrote:

On Tue, Nov 30, 2010 at 7:18 PM, Jesse Callaway <jcallaway@limelabs.com

wrote:
I figured out a workaround. Looking in the rdocs for chef I found a
name()
method in the Node class. So the template now has

node_name "<%= node.name() %>"

So this allows nodes which are not registered by their fqdn to have
the
chef::client_service recipe in their run list.

What was wrong with the syntax of node[:name]? I'm still learning!

The node name isn't an attribute the way that attributes set by ohai
or your recipes are, so you can't access it in the same way.

Word. Thanks. That makes sense.

-jesse

Dan DeLeo