Knife Bootstrap for installing anf configuring chef client


#1

Hi,

i am beginner on Chef, i’ve installed chef server using this link
http://blog.frameos.org/2011/05/19/installing-chef-server-0-10-in-rhel-6-scientificlinux-6/
and trying to install and configure chef client using knife bootstrap in the
same link.

but i don’t Knife command working here and guess some packages are missing or
i’ve have to configure knife as knife --help doesn’t return any thing

so, how can i make knife bootstrap work. please provide me solution for it.

Thanks,
Goutam


#2

Hey Gautam,

Have you referred the link [1], also checkout the new docs site [2]

Regards,
Mohit

[1] http://wiki.opscode.com/display/chef/Knife+Bootstrap
[2] http://docs.opscode.com

On Sun, Nov 18, 2012 at 2:25 PM, goutam goutamchiraniya@gmail.com wrote:

Hi,

i am beginner on Chef, i’ve installed chef server using this link

http://blog.frameos.org/2011/05/19/installing-chef-server-0-10-in-rhel-6-scientificlinux-6/
and trying to install and configure chef client using knife bootstrap in
the
same link.

but i don’t Knife command working here and guess some packages are missing
or
i’ve have to configure knife as knife --help doesn’t return any thing

so, how can i make knife bootstrap work. please provide me solution for it.

Thanks,
Goutam


*
Mohit Sethi*
Twitter, Github: mohitsethi
Skype: mohit.sethi7


#3

Hi Mohit,

i went through this but my question is if knife comand is it self not
working then do we require any additional packages or some to get it
working.

for eg:

[root@RHEL55 ~]# knife --help
-bash: knife: command not found

On Sun, Nov 18, 2012 at 2:31 PM, Mohit Sethi mohit@sethis.in wrote:

Hey Gautam,

Have you referred the link [1], also checkout the new docs site [2]

Regards,
Mohit

[1] http://wiki.opscode.com/display/chef/Knife+Bootstrap
[2] http://docs.opscode.com

On Sun, Nov 18, 2012 at 2:25 PM, goutam goutamchiraniya@gmail.com wrote:

Hi,

i am beginner on Chef, i’ve installed chef server using this link

http://blog.frameos.org/2011/05/19/installing-chef-server-0-10-in-rhel-6-scientificlinux-6/
and trying to install and configure chef client using knife bootstrap in
the
same link.

but i don’t Knife command working here and guess some packages are missing
or
i’ve have to configure knife as knife --help doesn’t return any thing

so, how can i make knife bootstrap work. please provide me solution for
it.

Thanks,
Goutam

Mohit Sethi
Twitter, Github: mohitsethi
Skype: mohit.sethi7


#4

Are you running knife on the same machine you installed chef server?

Try running “chef-client -v”. If that also says command not found then you
don’t have chef-client or it’s related commands knife, chef-solo, ohai
installed. If you want to install chef-client in a similar manner as you
did chef-server then do the following.

rpm -Uvh http://rbel.frameos.org/rbel6 yum install -y ruby rubygem-chef ntp

But if it were up to me I would not use the bootstrap instructions found at

http://blog.frameos.org/2011/05/19/bootstraping-rhelcentos-6-chef-0-10-nodes-using-rbel-rpms/

I would use the standard install method provided by Opscode here.
http://www.opscode.com/chef/install/

This will install the latest version of chef-client (including knife) on
just about any operating system. And it will use the preferred omnibus
style install rather than a ruby gems style.


#5

I forgot to mention that once you have chef-client installed you will be
able to run “knife bootstrap” with appropriate arguments to bootstrap other
nodes.

Adding the “-d” option to knife bootstrap tells knife what bootstrap
template to use.

My preference is to just run knife bootstrap without “-d”. That makes sure
knife is installing chef-client in the most appropriate way for whatever
operating system I am bootstrapping.


#6

yes Jeremiah, i am trying this on chef server , i am using Linux
version 5 and installed rbel5 as rbel6 RPM were not working for me to
install Chef server.

Do i have to use another node for and use this

rpm -Uvh http://rbel.frameos.org/rbel6 yum install -y ruby rubygem-chef ntp

to install chef client ?

i am using bootstrap because it will configure the communication b/w
chef server and client as well , as i don’t have much idea how to
configure it.

so, the question here would be do i have to use bootstrap on other
node , in which i have to install chef client first but again how it
will communicate with Chef server ?

Thanks you for your reply !!

On Sun, Nov 18, 2012 at 3:37 PM, Jeremiah Snapp
jeremiah.snapp@gmail.com wrote:

Are you running knife on the same machine you installed chef server?

Try running “chef-client -v”. If that also says command not found then you
don’t have chef-client or it’s related commands knife, chef-solo, ohai
installed. If you want to install chef-client in a similar manner as you
did chef-server then do the following.

rpm -Uvh http://rbel.frameos.org/rbel6 yum install -y ruby rubygem-chef ntp

But if it were up to me I would not use the bootstrap instructions found at

http://blog.frameos.org/2011/05/19/bootstraping-rhelcentos-6-chef-0-10-nodes-using-rbel-rpms/

I would use the standard install method provided by Opscode here.
http://www.opscode.com/chef/install/

This will install the latest version of chef-client (including knife) on
just about any operating system. And it will use the preferred omnibus style
install rather than a ruby gems style.


#7

“knife bootstrap” is run from a system (typically a management
workstation) that already has chef-client installed and configured
correctly. “knife bootstrap” is used to install chef-client on other
systems (nodes). During the bootstrap process it uses the information
from your management workstation to correctly configure chef-client on
the node getting bootstrapped.

The rpms you are using are very out of date but if you want to
continue down that path for now then I would log into your chef-server
and install chef-client using these instructions.

http://blog.frameos.org/2011/11/04/installing-chef-client-from-rbel-in-rhelcentos/

Then you should be able to run the following command to configure
knife on your chef-server. You may need to run it as root. You can
change chef.admin and ‘~/chef-repo’ to whatever you want.
cd ~
knife configure -i --defaults -u chef.admin -r ~/chef-repo
knife client list

Knife should query the server and display ‘chef.admin’ as proof that
it’s working.

On your workstation you should just use the chef-client install script
found at http://www.opscode.com/chef/install/ to install chef-client.

Then you can copy the ~/.chef directory from your chef-server to your
management workstation. You will also need to copy the
/etc/chef/validation.pem file from your chef-server to your ~/.chef
directory on your workstation. You will need to modify the paths and
probably the url in ~/.chef/knife.rb on your workstation. Now run
’knife client list’ from your workstation and see if it works.

Now you should be able to run ‘knife bootstrap’ from your workstation
to bootstrap other systems (nodes).

This new blog post might help you if you’d rather not use frameos.org’s rpm’s.
http://jtimberman.housepub.org/blog/2012/11/17/install-chef-10-server-on-centos/


#8

Thanks a lot Jeremiah… :slight_smile:

On Sun, Nov 18, 2012 at 6:47 PM, Jeremiah Snapp
jeremiah.snapp@gmail.com wrote:

“knife bootstrap” is run from a system (typically a management
workstation) that already has chef-client installed and configured
correctly. “knife bootstrap” is used to install chef-client on other
systems (nodes). During the bootstrap process it uses the information
from your management workstation to correctly configure chef-client on
the node getting bootstrapped.

The rpms you are using are very out of date but if you want to
continue down that path for now then I would log into your chef-server
and install chef-client using these instructions.

http://blog.frameos.org/2011/11/04/installing-chef-client-from-rbel-in-rhelcentos/

Then you should be able to run the following command to configure
knife on your chef-server. You may need to run it as root. You can
change chef.admin and ‘~/chef-repo’ to whatever you want.
cd ~
knife configure -i --defaults -u chef.admin -r ~/chef-repo
knife client list

Knife should query the server and display ‘chef.admin’ as proof that
it’s working.

On your workstation you should just use the chef-client install script
found at http://www.opscode.com/chef/install/ to install chef-client.

Then you can copy the ~/.chef directory from your chef-server to your
management workstation. You will also need to copy the
/etc/chef/validation.pem file from your chef-server to your ~/.chef
directory on your workstation. You will need to modify the paths and
probably the url in ~/.chef/knife.rb on your workstation. Now run
’knife client list’ from your workstation and see if it works.

Now you should be able to run ‘knife bootstrap’ from your workstation
to bootstrap other systems (nodes).

This new blog post might help you if you’d rather not use frameos.org’s rpm’s.
http://jtimberman.housepub.org/blog/2012/11/17/install-chef-10-server-on-centos/


#9

Hi,

while using knife bootstraping it fails out with these errors could
you please in to it . i’ve attached the file

On Sun, Nov 18, 2012 at 11:19 PM, GOUTAM CHIRANIA
goutamchiraniya@gmail.com wrote:

Thanks a lot Jeremiah… :slight_smile:

On Sun, Nov 18, 2012 at 6:47 PM, Jeremiah Snapp
jeremiah.snapp@gmail.com wrote:

“knife bootstrap” is run from a system (typically a management
workstation) that already has chef-client installed and configured
correctly. “knife bootstrap” is used to install chef-client on other
systems (nodes). During the bootstrap process it uses the information
from your management workstation to correctly configure chef-client on
the node getting bootstrapped.

The rpms you are using are very out of date but if you want to
continue down that path for now then I would log into your chef-server
and install chef-client using these instructions.

http://blog.frameos.org/2011/11/04/installing-chef-client-from-rbel-in-rhelcentos/

Then you should be able to run the following command to configure
knife on your chef-server. You may need to run it as root. You can
change chef.admin and ‘~/chef-repo’ to whatever you want.
cd ~
knife configure -i --defaults -u chef.admin -r ~/chef-repo
knife client list

Knife should query the server and display ‘chef.admin’ as proof that
it’s working.

On your workstation you should just use the chef-client install script
found at http://www.opscode.com/chef/install/ to install chef-client.

Then you can copy the ~/.chef directory from your chef-server to your
management workstation. You will also need to copy the
/etc/chef/validation.pem file from your chef-server to your ~/.chef
directory on your workstation. You will need to modify the paths and
probably the url in ~/.chef/knife.rb on your workstation. Now run
’knife client list’ from your workstation and see if it works.

Now you should be able to run ‘knife bootstrap’ from your workstation
to bootstrap other systems (nodes).

This new blog post might help you if you’d rather not use frameos.org’s rpm’s.
http://jtimberman.housepub.org/blog/2012/11/17/install-chef-10-server-on-centos/


#10

You need to change your url in ~/.chef/knife.rb. It has to point to
your chef-server. Right now it’s pointing to localhost.

On Sun, Nov 18, 2012 at 3:05 PM, GOUTAM CHIRANIA
goutamchiraniya@gmail.com wrote:

Hi,

while using knife bootstraping it fails out with these errors could
you please in to it . i’ve attached the file

On Sun, Nov 18, 2012 at 11:19 PM, GOUTAM CHIRANIA
goutamchiraniya@gmail.com wrote:

Thanks a lot Jeremiah… :slight_smile:

On Sun, Nov 18, 2012 at 6:47 PM, Jeremiah Snapp
jeremiah.snapp@gmail.com wrote:

“knife bootstrap” is run from a system (typically a management
workstation) that already has chef-client installed and configured
correctly. “knife bootstrap” is used to install chef-client on other
systems (nodes). During the bootstrap process it uses the information
from your management workstation to correctly configure chef-client on
the node getting bootstrapped.

The rpms you are using are very out of date but if you want to
continue down that path for now then I would log into your chef-server
and install chef-client using these instructions.

http://blog.frameos.org/2011/11/04/installing-chef-client-from-rbel-in-rhelcentos/

Then you should be able to run the following command to configure
knife on your chef-server. You may need to run it as root. You can
change chef.admin and ‘~/chef-repo’ to whatever you want.
cd ~
knife configure -i --defaults -u chef.admin -r ~/chef-repo
knife client list

Knife should query the server and display ‘chef.admin’ as proof that
it’s working.

On your workstation you should just use the chef-client install script
found at http://www.opscode.com/chef/install/ to install chef-client.

Then you can copy the ~/.chef directory from your chef-server to your
management workstation. You will also need to copy the
/etc/chef/validation.pem file from your chef-server to your ~/.chef
directory on your workstation. You will need to modify the paths and
probably the url in ~/.chef/knife.rb on your workstation. Now run
’knife client list’ from your workstation and see if it works.

Now you should be able to run ‘knife bootstrap’ from your workstation
to bootstrap other systems (nodes).

This new blog post might help you if you’d rather not use frameos.org’s rpm’s.
http://jtimberman.housepub.org/blog/2012/11/17/install-chef-10-server-on-centos/


#11

Hi Goutam,

knife comes from a ruby gem.

Check out
http://wiki.opscode.com/display/chef/Workstation+Setup+for+CentOS%2C+Red+Ha
t%2C+Fedora to see if that gets on you the right path.

-jimW

On 11/18/12 1:55 AM, “goutam” goutamchiraniya@gmail.com wrote:

Hi,

i am beginner on Chef, i’ve installed chef server using this link
http://blog.frameos.org/2011/05/19/installing-chef-server-0-10-in-rhel-6-s
cientificlinux-6/
and trying to install and configure chef client using knife bootstrap in
the
same link.

but i don’t Knife command working here and guess some packages are
missing or
i’ve have to configure knife as knife --help doesn’t return any thing

so, how can i make knife bootstrap work. please provide me solution for
it.

Thanks,
Goutam


#12

Don’t use the frameos.org repository. They did a great job at the time, but it has been superseded by the Opscode omnibus installation (Google for it; it’s the easiest way to find the instructions).

The omnibus installation gives you a more recent version of Chef. Older versions, including I believe the one from frameos.org, didn’t support RHEL 6 out of the box.

I would also recommend that you look into understanding the communication between chef client and chef server, since that is central to many aspects of the system. Without understanding it, you probably won’t be able to get bootstrap to work.

Fundamentally, it is standard HTTP (over ports 4000 instead of the normal port 80). If you go over a public untrusted network, you would want to use HTTPS, which is a little tricky to set up.

Bootstrap simply uses SSH to connect to the machine you want to bootstrap, and then sends a few commands that downloads and installs chef-client. Once it is installed, it simply runs chef-client as normal.

-----Original message-----
From: GOUTAM CHIRANIA goutamchiraniya@gmail.com
Sent: Sun 11-18-2012 02:38 am
Subject: [chef] Re: Re: Re: Re: Knife Bootstrap for installing anf configuring chef client
To: chef@lists.opscode.com;
yes Jeremiah, i am trying this on chef server , i am using Linux
version 5 and installed rbel5 as rbel6 RPM were not working for me to
install Chef server.

Do i have to use another node for and use this

rpm -Uvh http://rbel.frameos.org/rbel6 yum install -y ruby rubygem-chef ntp

to install chef client ?

i am using bootstrap because it will configure the communication b/w
chef server and client as well , as i don’t have much idea how to
configure it.

so, the question here would be do i have to use bootstrap on other
node , in which i have to install chef client first but again how it
will communicate with Chef server ?

Thanks you for your reply !!

On Sun, Nov 18, 2012 at 3:37 PM, Jeremiah Snapp
jeremiah.snapp@gmail.com wrote:

Are you running knife on the same machine you installed chef server?

Try running “chef-client -v”. If that also says command not found then you
don’t have chef-client or it’s related commands knife, chef-solo, ohai
installed. If you want to install chef-client in a similar manner as you
did chef-server then do the following.

rpm -Uvh http://rbel.frameos.org/rbel6 yum install -y ruby rubygem-chef ntp

But if it were up to me I would not use the bootstrap instructions found at

http://blog.frameos.org/2011/05/19/bootstraping-rhelcentos-6-chef-0-10-nodes-using-rbel-rpms/

I would use the standard install method provided by Opscode here.
http://www.opscode.com/chef/install/

This will install the latest version of chef-client (including knife) on
just about any operating system. And it will use the preferred omnibus style
install rather than a ruby gems style.