Permalink
Browse files

removed cookbooks; fixed pacakge_rpm

  • Loading branch information...
exceedhl committed Nov 4, 2011
1 parent cc8d3db commit c63815f97798f0d4a0a90d2d020e909c85b59f7d
View
@@ -69,10 +69,25 @@ task :package_rpm do
cp_r Dir.glob("#{src_dir}/bin/centos/*"), "#{content_dir}/usr/bin"
cp_r Dir.glob("#{src_dir}/lxc-templates/*"), "#{content_dir}/usr/lib/lxc/templates"
+ pre_install_script = <<-eos
+#!/bin/sh -e
+# intsall lxc if not exist
+if [[ ! -f /usr/bin/lxc-ls ]]; then
+ (cd /tmp && \
+ wget http://lxc.sourceforge.net/download/lxc/lxc-0.7.4.tar.gz && \
+ tar zxf lxc-0.7.4.tar.gz && \
+ cd lxc-0.7.4 && \
+ ./configure --prefix=/usr --with-config-path=/var/lib/lxc && \
+ make && \
+ make install)
+fi
+eos
+
post_install_script = <<-eos
#!/bin/sh -e
/usr/bin/lxc-prepare-host
eos
+ File.open("#{PROJECT_ROOT}/pkg/toft-lxc-pre-install.sh", 'w') { |f| f.write(pre_install_script) }
File.open("#{PROJECT_ROOT}/pkg/toft-lxc-post-install.sh", 'w') { |f| f.write(post_install_script) }
Dir.chdir("pkg") do
@@ -93,6 +108,7 @@ eos
-d ntp \
-d libcap-devel \
--post-install "#{PROJECT_ROOT}/pkg/toft-lxc-post-install.sh" \
+ --pre-install "#{PROJECT_ROOT}/pkg/toft-lxc-pre-install.sh" \
.
EOF
end
View
@@ -8,11 +8,10 @@ Vagrant::Config.run do |config|
config.vm.define :ubuntu64 do |config|
config.vm.box = "ubuntu-1104-server-amd64"
config.vm.network "33.33.33.14"
- config.vm.boot_mode = :gui
config.vm.share_folder("v-root4", "/home/vagrant/code", ".", :nfs => true)
end
- config.vm.define :centos6i386 do |config|
+ config.vm.define :c386 do |config|
config.vm.box = "centos6-i386"
config.vm.network "33.33.33.12"
config.vm.share_folder("v-root1", "/home/vagrant/code", ".", :nfs => true)
View
@@ -3,7 +3,7 @@
require 'toft'
CHEF_FIXTURE_PATH = File.dirname(__FILE__) + '/../../fixtures/chef'
-CONTAINER_TYPE = "lenny"
+CONTAINER_TYPE = "natty"
World(Toft)
@@ -12,18 +12,6 @@ netmask="255.255.255.0"
range="192.168.20.2 192.168.20.254"
domain=foo
-
-# intsall lxc
-if [[ ! -f /usr/bin/lxc-ls ]]; then
- (cd /tmp && \
- wget http://lxc.sourceforge.net/download/lxc/lxc-0.7.4.tar.gz && \
- tar zxf lxc-0.7.4.tar.gz && \
- cd lxc-0.7.4 && \
- ./configure --prefix=/usr --with-config-path=/var/lib/lxc && \
- make && \
- make install)
-fi
-
# setup bridge interface
if [[ ! `ip link ls dev br0` ]]; then
brctl addbr br0
@@ -1 +0,0 @@
-default[:network][:gateway_ip] = "192.168.20.1"
@@ -1,42 +0,0 @@
-%w{lxc bridge-utils debootstrap}.each do |pkg|
- package "#{pkg}"
-end
-
-bash "set up networking" do
- code <<-EOH
-brctl addbr br0
-ifconfig br0 #{node.network.gateway_ip} netmask 255.255.255.0 up
-iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
-sysctl -w net.ipv4.ip_forward=1
-EOH
- not_if "ip link ls dev br0"
-end
-
-directory "/cgroup" do
- action :create
-end
-
-mount "/cgroup" do
- device "cgroup"
- fstype "cgroup"
- pass 0
- action [:mount, :enable]
-end
-
-template "/usr/lib/lxc/templates/lxc-lucid" do
- source "lxc-lucid"
- mode "0755"
- action :create
-end
-
-template "/usr/lib/lxc/templates/lxc-natty" do
- source "lxc-natty"
- mode "0755"
- action :create
-end
-
-template "/usr/lib/lxc/templates/lxc-centos-6" do
- source "lxc-centos-6"
- mode "0755"
- action :create
-end
Oops, something went wrong.

0 comments on commit c63815f

Please sign in to comment.