Automating chef client installation

Hi,

I am doing an automatic ubuntu installation and at the end of the
installation I execute this post-install script that I hoped would create
me a chef client on the newly installed machine.

#!/bin/bash

wget -O /home/ubuntu/opscode.list http://10.1.1.6/files/opscode.list
echo “changeme” | sudo -S cp /home/ubuntu/opscode.list
/etc/apt/sources.list.d

echo “pass” | sudo -S mkdir -p /etc/apt/trusted.gpg.d
echo “pass” | sudo -S gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
echo “pass” | sudo -S gpg --export packages@opscode.com | sudo tee
/etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null

echo “pass” | sudo -S apt-get install opscode-keyring

echo "chef chef/chef_server_url string http://10.1.1.8:4000"
debconf-set-selections && apt-get install chef -y

wget -O /home/ubuntu/validation.pem http://10.1.1.6/files/validation.pem
echo “pass” | sudo -S cp /home/ubuntu/validation.pem /etc/chef

exit 0

Everything seems to work. The validation.pem is in the correct place, there
is a chef-client process running, but, the client.rb in /etc/chef is empty.
What am I missing here?

Thanks

Kelly

On 29 December 2011 02:18, Kelly Goedert kelly.goedert@gmail.com wrote:

Hi,

I am doing an automatic ubuntu installation and at the end of the
installation I execute this post-install script that I hoped would create me
a chef client on the newly installed machine.

#!/bin/bash

wget -O /home/ubuntu/opscode.list http://10.1.1.6/files/opscode.list
echo "changeme" | sudo -S cp /home/ubuntu/opscode.list
/etc/apt/sources.list.d

echo "pass" | sudo -S mkdir -p /etc/apt/trusted.gpg.d
echo "pass" | sudo -S gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
echo "pass" | sudo -S gpg --export packages@opscode.com | sudo tee
/etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null

echo "pass" | sudo -S apt-get install opscode-keyring

echo "chef chef/chef_server_url string http://10.1.1.8:4000"
debconf-set-selections && apt-get install chef -y

Missing pipe here?

--AJ

wget -O /home/ubuntu/validation.pem http://10.1.1.6/files/validation.pem
echo "pass" | sudo -S cp /home/ubuntu/validation.pem /etc/chef

exit 0

Everything seems to work. The validation.pem is in the correct place, there
is a chef-client process running, but, the client.rb in /etc/chef is empty.
What am I missing here?

Thanks

Kelly