This article is about Ubuntu in all the machines used, client, server and node.
Node: target server – has nothing, we want to put some services on that
Server: a chef server we will use to set up nodes
Client: our local machine that controls and produces content for the chef server. Runs knife, which is the chef tool
- Download and install chef server package from ops code. link: http://www.getchef.com/chef/install/ make sure you use the server version and not the client. For now it is up to 12.10 although Ubuntu server is already version 1310. The login information is
Username admin Password p@ssw0rd1
- On the same link, under client, download and install the client software, this time under client tab.
- Now you have the client installed. run knife –version to see that knife is installed (will return chef:xx.x.x) or a similar format
- login to the chef server you created, get the private keys for both the admin (or create an admin user, but you’ve already have one) and the chef-validator client (user is not a client). you need the private keys, so you must re-generate these. It is under edit. make sure you copy that pem text data, it will not be available again (but you can create a new one in the same way).
- Then configure knife, use http://www.getchef.com/blog/2013/03/11/chef-11-server-up-and-running/
- To set-up keys for the server, use this link (not needed if you are using a password)
- to run knife on the remote node run: knife bootstrap FQDN –sudo -x USERNAME -P PASSWORD -N NODENAME. This should connect, install and configure the remote (or virtual) node with all the information needed.
- To do this on ec2, you have no password, so a key must be used!
- Check your server->nodes it should be up there (in the default) environment
- Next, you must set a server FQDN. to do that:
/etc/hostname, to e.g.
hostname -F /etc/hostname
- IP addresses are acceptable
- To create a cookbook named apache, user knife cookbook create apache.
- to push use knife cookbook upload [name]
- Too many authentication failures for XXX if you have too many ssh keys in your ssh dir (might happen…).
- Agent admitted failure to sign using the key. (Usually after error 1 was fixed by deleting all the keys) type ssh-add, this should fix this.
- ERROR: TypeError: can’t convert nil into String – (on ubuntu) solved by using the -o flag with a dir name to store the cookbook. This is usually a hack meaning there is something wrong with your configuration file, knife.rb.