- From: Motiejus Jakštys <
>
- To:
- Subject: [chef] Re: advise on first chef invocation on a VM
- Date: Sat, 2 Jun 2012 17:32:49 +0200
On Sat, Jun 2, 2012 at 4:48 PM, Motiejus Jakštys
<
>
wrote:
>
Hi,
>
>
we are creating chef nodes using xen-create-image. I am creating a
>
separate role, which is supposed to install chef via omnibus. There
>
are two approaches to that:
>
1) run chef-client to fully install the system during xen-create-image
>
phase (in chroot)
>
2) install chef the way that after first reboot it would run
>
chef-client and completely configure by itself.
>
>
I would prefer (2), because it is more "real" scenario, and would not
>
increase (quite long already) time of xen-create-image.
>
>
Is there a way to install chef with only chef-client recipe? Or is it
>
generally considered "ok" to do it the (1) way?
Found it! Here is the script :)
chroot ${prefix} http_proxy=
http://wwwcache:8080 wget
-O/tmp/install.sh
http://www.opscode.com/chef/install.sh
chroot ${prefix} http_proxy=
http://wwwcache:8080 bash /tmp/install.sh
chroot ${prefix} knife configure client /etc/chef -s "
http://chef.server:4000"
cp /etc/chef/validation.pem ${prefix}/etc/chef/
chroot ${prefix} chef-client -o recipe[chef-client]
chroot ${prefix} /etc/init.d/chef-client stop
The whole secret is chef-client -o.
--
Motiejus Jakštys
Archive powered by MHonArc 2.6.16.