Permalink
Browse files

add posibility to use 'autopart' or 'part' in redhat's kickstart

  • Loading branch information...
1 parent e6cb13c commit 104b0664062f11bafa0a2577c19d8cb264a5639a @faja faja committed May 9, 2013
Showing with 33 additions and 0 deletions.
  1. +21 −0 lib/project_razor/model/redhat.rb
  2. +12 −0 lib/project_razor/model/redhat/6/kickstart.erb
View
21 lib/project_razor/model/redhat.rb
@@ -57,6 +57,27 @@ def initialize(hash)
:required => true,
:description => "root password (> 8 characters)"
},
+ "@root_partition_size" => {
+ :default => "16384",
+ :example => "6144",
+ :validation => '^\d+$',
+ :required => true,
+ :description => "size (in megabytes) of root partition (valid if autopart == false)"
+ },
+ "@swap_partition_size" => {
+ :default => "8192",
+ :example => "2048",
+ :validation => '^\d+$',
+ :required => true,
+ :description => "size (in megabytes) of swap partition (valid if autopart == false)"
+ },
+ "@autopart" => {
+ :default => "true",
+ :example => "false",
+ :validation => '(true|false)',
+ :required => true,
+ :description => "if you want to use 'autopart' option"
+ },
}
end
View
12 lib/project_razor/model/redhat/6/kickstart.erb
@@ -20,7 +20,19 @@ bootloader --location=mbr --driveorder=sda --append=crashkernel=auto rhgb quiet
# not guaranteed to work
zerombr
clearpart --all --initlabel
+
+<% if @autopart == "true"%>
autopart
+<% else %>
+part /boot --asprimary --fstype="ext4" --size=200
+<% if @swap_partition_size.to_i != 0 %>
+part swap --asprimary --fstype="swap" --size=<%= @swap_partition_size %>
+<% end %>
+part pv.0 --asprimary --size=1 --grow
+volgroup VG0 pv.0
+logvol / --fstype ext4 --name=VolRoot --vgname=VG0 --size=<%= @root_partition_size %>
+<% end %>
+
# reboot automatically
reboot

0 comments on commit 104b066

Please sign in to comment.