Browse files

run chef from within the chroot

  • Loading branch information...
1 parent 552b793 commit 2be545e72926f1b2d5547d82490cf08668d4f223 @phlipper phlipper committed Jan 23, 2011
Showing with 14 additions and 3 deletions.
  1. +14 −3 chef/cookbooks/kidsruby/recipes/chroot-bootstrap.rb
@@ -19,7 +19,18 @@
command "`which chroot` /root/tmp/remaster-root /bin/bash -c 'sh /'"
-# copy the host cookbooks to the chroot
-execute "Copy Chef cookbooks to the chroot" do
- command "cp -R /tmp/vagrant-chef/cookbooks-0 /root/tmp/remaster-root/chef-cookbooks"
+# copy the host chef configuration to the chroot
+execute "Copy Chef to the chroot" do
+ command "cp -R /tmp/vagrant-chef /root/tmp/remaster-root/vagrant-chef"
+execute "update chef configuration paths in the chroot" do
+ command [
+ "sed -i 's/\\/tmp//g' /root/tmp/remaster-root/vagrant-chef/solo.rb",
+ "sed -i 's/role\\[vm_host\\]/role\\[livecd\\]/' /root/tmp/remaster-root/vagrant-chef/dna.json"
+ ].join(" && ")
+execute "run chef within the chroot" do
+ command "`which chroot` /root/tmp/remaster-root /bin/bash -c 'chef-solo -c /vagrant-chef/solo.rb -j /vagrant-chef/dna.json'"

0 comments on commit 2be545e

Please sign in to comment.