diff --git a/cookbooks/cobbler/attributes/default.rb b/cookbooks/cobbler/attributes/default.rb index a63cce831f..52a7f058cc 100644 --- a/cookbooks/cobbler/attributes/default.rb +++ b/cookbooks/cobbler/attributes/default.rb @@ -11,13 +11,15 @@ default["cobbler"]["repoaddr"] = default_conf[:server] default["cobbler"]["ks_mirror_dir"] = "/var/www/cobbler/ks_mirror" default["cobbler"]["preseed_dir"] = "/var/lib/cobbler/kickstarts" - -default["cobbler"]["bootstrap_kernel"] = "/var/lib/mirror/bootstrap/linux" -default["cobbler"]["bootstrap_initrd"] = "/var/lib/mirror/bootstrap/initrd.gz" +default["cobbler"]["bootstrap_mnt"] = "/var/lib/mirror/bootstrap" +# default["cobbler"]["bootstrap_kernel"] = "/var/lib/mirror/bootstrap/linux" +# default["cobbler"]["bootstrap_initrd"] = "/var/lib/mirror/bootstrap/initrd.gz" default["cobbler"]["precise-x86_64_iso"] = "/var/lib/mirror/netinst/precise-x86_64.iso" default["cobbler"]["precise-x86_64_mnt"] = "/var/lib/mirror/netinst/precise-x86_64" +default["cobbler"]["centos-6.2-x86_64_iso"] = "/var/lib/mirror/netinst/CentOS-6.2-x86_64-netinstall.iso" +default["cobbler"]["centos-6.2-x86_64_mnt"] = "/var/lib/mirror/netinst/centos-6.2-x86_64" diff --git a/cookbooks/cobbler/definitions/distro.rb b/cookbooks/cobbler/definitions/distro.rb index 52d8be847b..8b47bb6cd9 100644 --- a/cookbooks/cobbler/definitions/distro.rb +++ b/cookbooks/cobbler/definitions/distro.rb @@ -1,4 +1,4 @@ -define :distro do +define :cobbler_distro do name = params[:name] kernel = params[:kernel] initrd = params[:initrd] diff --git a/cookbooks/cobbler/definitions/profile.rb b/cookbooks/cobbler/definitions/profile.rb index e49dfc1b23..20b2e8c2f6 100644 --- a/cookbooks/cobbler/definitions/profile.rb +++ b/cookbooks/cobbler/definitions/profile.rb @@ -1,4 +1,4 @@ -define :profile, :menu => true, :kickstart => nil do +define :cobbler_profile, :menu => true, :kickstart => nil do name = params[:name] kopts = params[:kopts] distro = params[:distro] diff --git a/cookbooks/cobbler/definitions/system.rb b/cookbooks/cobbler/definitions/system.rb index a04c67d545..72e37fdb49 100644 --- a/cookbooks/cobbler/definitions/system.rb +++ b/cookbooks/cobbler/definitions/system.rb @@ -1,4 +1,4 @@ -define :system, :netboot => true do +define :cobbler_system, :netboot => true do name = params[:name] profile = params[:profile] if params[:netboot] == true @@ -7,13 +7,13 @@ define :system, :netboot => true do netboot = "False" end - execute "add_system_#{default}" do + execute "add_system_#{name}" do command "cobbler system add \ --name=#{name} \ --profile=#{profile} \ --netboot-enabled=#{netboot}" action :run - only_if "test -z `cobbler profile find --name #{name}`" + only_if "test -z `cobbler system find --name #{name}`" end execute "edit_system_#{name}" do @@ -22,7 +22,7 @@ define :system, :netboot => true do --profile=#{profile} \ --netboot-enabled=#{netboot}" action :run - only_if "test ! -z `cobbler profile find --name #{name}`" + only_if "test ! -z `cobbler system find --name #{name}`" end end diff --git a/cookbooks/cobbler/recipes/bootstrap.rb b/cookbooks/cobbler/recipes/bootstrap.rb index 1da7c02d69..812d86e584 100644 --- a/cookbooks/cobbler/recipes/bootstrap.rb +++ b/cookbooks/cobbler/recipes/bootstrap.rb @@ -2,25 +2,29 @@ # installed into node.cobbler.bootstrap_kernel and # node.cobbler.bootstrap_initrd correspondently -directory "#{node.cobbler.ks_mirror_dir}/bootstrap" do - owner "root" - group "root" - mode "0755" - recursive true - action :create +link "#{node.cobbler.ks_mirror_dir}/bootstrap" do + to "#{node["cobbler"]["bootstrap_mnt"]}" end -link "#{node.cobbler.ks_mirror_dir}/bootstrap/linux" do - to "#{node.cobbler.bootstrap_kernel}" - link_type :hard -end +# directory "#{node.cobbler.ks_mirror_dir}/bootstrap" do +# owner "root" +# group "root" +# mode "0755" +# recursive true +# action :create +# end -link "#{node.cobbler.ks_mirror_dir}/bootstrap/initrd.gz" do - to "#{node.cobbler.bootstrap_initrd}" - link_type :hard -end +# link "#{node.cobbler.ks_mirror_dir}/bootstrap/linux" do +# to "#{node.cobbler.bootstrap_kernel}" +# link_type :hard +# end -distro "bootstrap" do +# link "#{node.cobbler.ks_mirror_dir}/bootstrap/initrd.gz" do +# to "#{node.cobbler.bootstrap_initrd}" +# link_type :hard +# end + +cobbler_distro "bootstrap" do kernel "#{node.cobbler.ks_mirror_dir}/bootstrap/linux" initrd "#{node.cobbler.ks_mirror_dir}/bootstrap/initrd.gz" arch "x86_64" @@ -28,13 +32,13 @@ distro "bootstrap" do osversion "precise" end -profile "bootstrap" do +cobbler_profile "bootstrap" do kopts "root=/dev/ram0 rw ramdisk_size=614400" distro "bootstrap" menu true end -system "default" do +cobbler_system "default" do profile "bootstrap" netboot true end diff --git a/cookbooks/cobbler/recipes/default.rb b/cookbooks/cobbler/recipes/default.rb index 054513186a..35895e0203 100644 --- a/cookbooks/cobbler/recipes/default.rb +++ b/cookbooks/cobbler/recipes/default.rb @@ -78,5 +78,5 @@ end include_recipe "cobbler::bootstrap" include_recipe "cobbler::precise-x86_64" - +include_recipe "cobbler::centos-6.2-x86_64" diff --git a/cookbooks/cobbler/recipes/precise-x86_64.rb b/cookbooks/cobbler/recipes/precise-x86_64.rb index 1d95780f20..7447cab11c 100644 --- a/cookbooks/cobbler/recipes/precise-x86_64.rb +++ b/cookbooks/cobbler/recipes/precise-x86_64.rb @@ -19,6 +19,7 @@ directory "#{node["cobbler"]["precise-x86_64_mnt"]}" do owner "root" group "root" mode "0755" + not_if "test -d #{node["cobbler"]["precise-x86_64_mnt"]}" end mount "#{node["cobbler"]["precise-x86_64_mnt"]}" do @@ -27,10 +28,10 @@ mount "#{node["cobbler"]["precise-x86_64_mnt"]}" do end link "#{node.cobbler.ks_mirror_dir}/precise-x86_64" do - to #{node["cobbler"]["precise-x86_64_mnt"]} + to "#{node["cobbler"]["precise-x86_64_mnt"]}" end -distro "precise-x86_64" do +cobbler_distro "precise-x86_64" do kernel "#{node.cobbler.ks_mirror_dir}/precise-x86_64/linux" initrd "#{node.cobbler.ks_mirror_dir}/precise-x86_64/initrd.gz" arch "x86_64" @@ -38,7 +39,7 @@ distro "precise-x86_64" do osversion "precise" end -profile "precise-x86_64" do +cobbler_profile "precise-x86_64" do kickstart "#{node.cobbler.preseed_dir}/precise-x86_64.seed" kopts "priority=critical locale=en_US netcfg/choose_interface=auto" distro "precise-x86_64"