diff --git a/templates/firstboot/chef-client.sh b/templates/firstboot/chef-client.sh index 29c391d..fe060ef 100644 --- a/templates/firstboot/chef-client.sh +++ b/templates/firstboot/chef-client.sh @@ -52,4 +52,8 @@ EOF wget -O /etc/chef/validation.pem http://{{site.webservice_host}}:{{site.webservice_port}}/media/chef_validators/{{site.chef_validation_pem}} -/usr/bin/chef-client +# Configure chef-client upstart +mkdir /var/log/chef +cp /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.8/distro/debian/etc/init/chef-client.conf /etc/init/ +ln -s /lib/init/upstart-job /etc/init.d/chef-client +/etc/init.d/chef-client start diff --git a/templates/post_script/debian.sh b/templates/post_script/debian.sh index 53c91b8..137c619 100644 --- a/templates/post_script/debian.sh +++ b/templates/post_script/debian.sh @@ -7,6 +7,8 @@ if [ -s /root/install.sh ]; then sed -i /etc/rc.local -e 's_exit 0_/root/install.sh_' fi +ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa + echo "{{host.hostname}}" > /etc/hostname curl http://{{site.webservice_host}}:{{site.webservice_port}}/api/host/{{host.id}} -H "Content-type: application/json" -d '{"local_boot": 1}' -X "PUT" curl http://{{site.webservice_host}}:{{site.webservice_port}}/api/host/{{host.id}}/puppet_sig -X "DELETE"