Project

General

Profile

« Previous | Next » 

Revision 0fa5d146

Added by Dominic Cleal over 10 years ago

fixes #3752 - move data population from migrations into seed script

View differences:

app/controllers/unattended_controller.rb
layout false
# Methods which return configuration files for syslinux(pxe), pxegrub or g/ipxe
PXE_CONFIG_URLS = [:pxe_kickstart_config, :pxe_debian_config, :pxemenu] + TemplateKind.where("name LIKE ?","PXELinux").map(&:name)
PXEGRUB_CONFIG_URLS = [:pxe_jumpstart_config] + TemplateKind.where("name LIKE ?", "PXEGrub").map(&:name)
GPXE_CONFIG_URLS = [:gpxe_kickstart_config] + TemplateKind.where("name LIKE ?", "gPXE").map(&:name)
CONFIG_URLS = PXE_CONFIG_URLS + GPXE_CONFIG_URLS + PXEGRUB_CONFIG_URLS
PXE_CONFIG_URLS = TemplateKind.where("name LIKE ?","PXELinux").map(&:name)
PXEGRUB_CONFIG_URLS = TemplateKind.where("name LIKE ?", "PXEGrub").map(&:name)
IPXE_CONFIG_URLS = TemplateKind.where("name LIKE ?", "iPXE").map(&:name) + ['gPXE']
CONFIG_URLS = PXE_CONFIG_URLS + IPXE_CONFIG_URLS + PXEGRUB_CONFIG_URLS
# Methods which return valid provision instructions, used by the OS
PROVISION_URLS = [:kickstart, :preseed, :jumpstart ] + TemplateKind.where("name LIKE ?", "provision").map(&:name)
PROVISION_URLS = TemplateKind.where("name LIKE ?", "provision").map(&:name)
# Methods which returns post install instructions for OS's which require it
FINISH_URLS = [:preseed_finish, :jumpstart_finish] + TemplateKind.where("name LIKE ?", "finish").map(&:name)
FINISH_URLS = TemplateKind.where("name LIKE ?", "finish").map(&:name)
# We dont require any of these methods for provisioning
FILTERS = [:require_ssl, :require_login, :session_expiry, :update_activity_time, :set_taxonomy, :authorize]
......
after_filter :set_content_type
before_filter :set_admin_user, :only => :built
def kickstart
unattended_local
end
def preseed
unattended_local
end
def preseed_finish
unattended_local
end
# this actions is called by each operatingsystem post/finish script - it notify us that the OS installation is done.
def built
logger.info "#{controller_name}: #{@host.name} is Built!"
......
safe_render template.template
end
# Returns a valid GPXE config file to kickstart hosts
def gpxe_kickstart_config
end
def pxe_config
@kernel = @host.operatingsystem.kernel @host.arch
@initrd = @host.operatingsystem.initrd @host.arch
......
# i.e. /unattended/provision will render the provisioning template for the requesting host
TemplateKind.all.each do |kind|
define_method kind.name do
@type = kind.name
unattended_local
render_template kind.name
end
end
# Using alias_method causes test failures as iPXE method is unknown in an empty DB
def gPXE; iPXE; end
private
def render_template type
if (config = @host.configTemplate({ :kind => type }))
logger.debug "rendering DB template #{config.name} - #{type}"
safe_render config
else
msg = "unable to find #{type} template for [#{@host.name}] running [#{@host.operatingsystem}]"
logger.error msg
render :text => msg, :status => :not_found
end
end
# lookup for a host based on the ip address and if possible by a mac address(as sent by anaconda)
# if the host was found than its record will be in @host
# if the host doesn't exists, it will return 404 and the requested method will not be reached.
......
#TODO: Email the user who initiated this build operation.
end
# we try to find this host specific template
# if it doesn't exists, we'll try to find a local generic template
# otherwise render the default view
def unattended_local
if (config = @host.configTemplate({ :kind => @type }))
logger.debug "rendering DB template #{config.name} - #{@type}"
safe_render config and return
end
type = "unattended_local/#{request.path.gsub("/#{controller_name}/","")}.local"
render :template => type if File.exists?("#{Rails.root}/app/views/#{type}.rhtml")
end
def set_content_type
response.headers['Content-Type'] = 'text/plain'
end
app/models/concerns/orchestration/tftp.rb
return unless tftp?
return unless operatingsystem
return if Rails.env == "test"
if configTemplate({:kind => operatingsystem.template_kind}).nil? and configTemplate({:kind => "gPXE"}).nil?
if configTemplate({:kind => operatingsystem.template_kind}).nil? and configTemplate({:kind => "iPXE"}).nil?
failure _("No %{template_kind} templates were found for this host, make sure you define at least one in your %{os} settings") % { :template_kind => operatingsystem.template_kind, :os => os }
end
end
......
pxe_render configTemplate({:kind => os.template_kind}).template
else
if os.template_kind == "PXEGrub"
pxe_render ConfigTemplate.find_by_name("PXEGrub Localboot Default").template
pxe_render ConfigTemplate.find_by_name("PXEGrub default local boot").template
else
pxe_render ConfigTemplate.find_by_name("PXE Localboot Default").template
pxe_render ConfigTemplate.find_by_name("PXELinux default local boot").template
end
end
rescue => e
app/models/config_template.rb
include Taxonomix
audited :allow_mass_assignment => true
self.auditing_enabled = !(File.basename($0) == "rake" && ARGV.include?("db:migrate"))
attr_accessible :name, :template, :template_kind_id, :snippet, :template_combinations_attributes, :operatingsystem_ids, :audit_comment
attr_accessible :name, :template, :template_kind, :template_kind_id, :snippet, :template_combinations_attributes, :operatingsystems, :operatingsystem_ids, :audit_comment
validates :name, :presence => true, :uniqueness => true
validates :name, :template, :presence => true
validates :template_kind_id, :presence => true, :unless => Proc.new {|t| t.snippet }
......
error_msg = _("No TFTP proxies defined, can't continue")
end
if (default_template = ConfigTemplate.find_by_name("PXE Default File")).nil?
error_msg = _("Could not find a Configuration Template with the name \"PXE Default File\", please create one.")
if (default_template = ConfigTemplate.find_by_name("PXELinux global default")).nil?
error_msg = _("Could not find a Configuration Template with the name \"PXELinux global default\", please create one.")
end
if error_msg.empty?
app/models/medium.rb
include Authorization
include Taxonomix
include ValidateOsFamily
audited :allow_mass_assignment => true
before_destroy EnsureNotUsedBy.new(:hosts, :hostgroups)
app/views/unattended/autowaik.xml.erb
#There will be content here later on
there will be content here later on
app/views/unattended/autoyast.xml.erb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general>
<mode>
<confirm config:type="boolean">false</confirm>
<final_reboot config:type="boolean">true</final_reboot>
</mode>
</general>
<networking>
<dns>
<hostname><%= @host.name %></hostname>
<resolv_conf_policy>auto</resolv_conf_policy>
</dns>
<interfaces config:type="list">
<interface>
<bootproto>dhcp</bootproto>
<device>eth0</device>
<startmode>auto</startmode>
<usercontrol>no</usercontrol>
</interface>
</interfaces>
</networking>
<ntp-client>
<configure_dhcp config:type="boolean">false</configure_dhcp>
<peers config:type="list">
<peer>
<address>ntp</address>
<initial_sync config:type="boolean">true</initial_sync>
<options></options>
<type>server</type>
</peer>
</peers>
<start_at_boot config:type="boolean">true</start_at_boot>
<start_in_chroot config:type="boolean">true</start_in_chroot>
</ntp-client>
<%= @host.diskLayout %>
<runlevel>
<default>3</default>
</runlevel>
<software>
<base>default</base>
<packages config:type="list">
<package>puppet</package>
<package>wget</package>
</packages>
</software>
<users config:type="list">
<user>
<username>root</username>
<encrypted config:type="boolean">true</encrypted>
<fullname>root</fullname>
<gid>0</gid>
<home>/root</home>
<shell>/bin/bash</shell>
<uid>0</uid>
<user_password><%= root_pass %></user_password>
</user>
</users>
<scripts>
<post-scripts config:type="list">
<script>
<filename>post.sh</filename>
<interpreter>shell</interpreter>
<network_needed config:type="boolean">true</network_needed>
<notification>Setting up Puppet / Foreman ...</notification>
<debug config:type="boolean">true</debug>
<source><![CDATA[
cat > /etc/puppet/puppet.conf << EOF
<%= snippets "puppet.conf" -%>
EOF
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server puppet --no-daemonize
/usr/bin/wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
/sbin/chkconfig puppet on -f
]]>
</source>
</script>
</post-scripts>
</scripts>
</profile>
app/views/unattended/autoyast/PXELinux.erb
<%#
kind: PXELinux
name: Community AutoYaST PXE
%>
default linux
label linux
kernel <%= @kernel %>
append initrd=<%= @initrd %> ramdisk_size=65536 install=<%= media_path %> autoyast=<%= foreman_url("provision") + "?format=xml" %> textmode=1
app/views/unattended/autoyast/disklayout_scsi.erb
<%#
kind: ptable
name: Community AutoYaST SCSI Disk
%>
<partitioning config:type="list">
<drive>
<device>/dev/sda</device>
<use>all</use>
</drive>
</partitioning>
app/views/unattended/autoyast/disklayout_virtual.erb
<%#
kind: ptable
name: Community AutoYaST Virtual Disk
%>
<partitioning config:type="list">
<drive>
<device>/dev/vda</device>
<use>all</use>
</drive>
</partitioning>
app/views/unattended/autoyast/provision.erb
<?xml version="1.0" encoding="UTF-8"?>
<%#
kind: provision
name: Community AutoYaST
%>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general>
<mode>
<confirm config:type="boolean">false</confirm>
<final_reboot config:type="boolean">true</final_reboot>
</mode>
</general>
<networking>
<dns>
<hostname><%= @host.name %></hostname>
<resolv_conf_policy>auto</resolv_conf_policy>
<% if @host.domain -%>
<searchlist config:type="list">
<search><%= @host.domain %></search>
</searchlist>
<% end -%>
</dns>
<interfaces config:type="list">
<interface>
<bootproto>dhcp</bootproto>
<device>eth0</device>
<startmode>auto</startmode>
<usercontrol>no</usercontrol>
</interface>
</interfaces>
</networking>
<ntp-client>
<configure_dhcp config:type="boolean">false</configure_dhcp>
<peers config:type="list">
<peer>
<address><%= @host.params["ntp-server"] || "0.opensuse.pool.ntp.org" %></address>
<initial_sync config:type="boolean">true</initial_sync>
<options></options>
<type>server</type>
</peer>
</peers>
<start_at_boot config:type="boolean">true</start_at_boot>
<start_in_chroot config:type="boolean">true</start_in_chroot>
</ntp-client>
<%= @host.diskLayout %>
<runlevel>
<default>3</default>
</runlevel>
<software>
<base>default</base>
<packages config:type="list">
<package>puppet</package>
<package>wget</package>
</packages>
</software>
<users config:type="list">
<user>
<username>root</username>
<encrypted config:type="boolean">true</encrypted>
<fullname>root</fullname>
<gid>0</gid>
<home>/root</home>
<shell>/bin/bash</shell>
<uid>0</uid>
<user_password><%= root_pass %></user_password>
</user>
</users>
<scripts>
<post-scripts config:type="list">
<script>
<filename>post.sh</filename>
<interpreter>shell</interpreter>
<network_needed config:type="boolean">true</network_needed>
<notification>Setting up Puppet / Foreman ...</notification>
<debug config:type="boolean">true</debug>
<source><![CDATA[
cat > /etc/puppet/puppet.conf << EOF
<%= snippet "puppet.conf" -%>
EOF
if [ -f "/etc/sysconfig/puppet" ]
then
/usr/bin/sed -ie s/^PUPPET_SERVER=.*/PUPPET_SERVER=<%= @host.puppetmaster %>/ /etc/sysconfig/puppet
fi
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
/usr/bin/wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
/sbin/chkconfig puppet on -f
]]>
</source>
</script>
</post-scripts>
</scripts>
<keyboard>
<keymap>english-us</keymap>
</keyboard>
<timezone>
<hwclock>UTC</hwclock>
<timezone>Etc/UTC</timezone>
</timezone>
</profile>
app/views/unattended/autoyast/provision_sles.erb
<?xml version="1.0" encoding="UTF-8"?>
<%#
kind: provision
name: Community AutoYaST SLES
oses:
- SLES 11
%>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general>
<mode>
<confirm config:type="boolean">false</confirm>
<final_reboot config:type="boolean">true</final_reboot>
</mode>
</general>
<networking>
<dns>
<hostname><%= @host.name %></hostname>
<resolv_conf_policy>auto</resolv_conf_policy>
<% if @host.domain -%>
<searchlist config:type="list">
<search><%= @host.domain %></search>
</searchlist>
<% end -%>
</dns>
<interfaces config:type="list">
<interface>
<bootproto>dhcp</bootproto>
<device>eth0</device>
<startmode>auto</startmode>
<usercontrol>no</usercontrol>
</interface>
</interfaces>
</networking>
<ntp-client>
<configure_dhcp config:type="boolean">false</configure_dhcp>
<peers config:type="list">
<peer>
<address><%= @host.params["ntp-server"] || "0.opensuse.pool.ntp.org" %></address>
<initial_sync config:type="boolean">true</initial_sync>
<options></options>
<type>server</type>
</peer>
</peers>
<start_at_boot config:type="boolean">true</start_at_boot>
<start_in_chroot config:type="boolean">true</start_in_chroot>
</ntp-client>
<%= @host.diskLayout %>
<runlevel>
<default>3</default>
</runlevel>
<software>
<base>default</base>
<packages config:type="list">
<package>puppet</package>
<package>wget</package>
<package>rubygem-ruby-augeas</package>
</packages>
</software>
<users config:type="list">
<user>
<username>root</username>
<encrypted config:type="boolean">true</encrypted>
<fullname>root</fullname>
<gid>0</gid>
<home>/root</home>
<shell>/bin/bash</shell>
<uid>0</uid>
<user_password><%= root_pass %></user_password>
</user>
</users>
<scripts>
<post-scripts config:type="list">
<script>
<filename>post.sh</filename>
<interpreter>shell</interpreter>
<network_needed config:type="boolean">true</network_needed>
<notification>Setting up Puppet / Foreman ...</notification>
<debug config:type="boolean">true</debug>
<source><![CDATA[
cat > /etc/puppet/puppet.conf << EOF
<%= snippet "puppet.conf" -%>
EOF
if [ -f "/etc/sysconfig/puppet" ]
then
/usr/bin/sed -ie s/^PUPPET_SERVER=.*/PUPPET_SERVER=<%= @host.puppetmaster %>/ /etc/sysconfig/puppet
fi
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
/usr/bin/wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
/sbin/chkconfig puppet on -f
]]>
</source>
</script>
</post-scripts>
</scripts>
<keyboard>
<keymap>english-us</keymap>
</keyboard>
<timezone>
<hwclock>UTC</hwclock>
<timezone>Etc/UTC</timezone>
</timezone>
<add-on>
<add_on_products config:type="list">
<listentry>
<!-- you have to update the next line with the actual URL of your SDK -->
<media_url>http://<your_server_here>/iso/suse/SDK/<%= @host.operatingsystem.major %>.<%= @host.operatingsystem.minor %>/<%= @host.architecture %>/</media_url>
<product>SuSE-Linux-SDK</product>
<product_dir>/</product_dir>
<name>SuSE-Linux-SDK</name>
</listentry>
<listentry>
<media_url><![CDATA[http://download.opensuse.org/repositories/systemsmanagement:/puppet/SLE_<%= @host.operatingsystem.major %>_SP<%= @host.operatingsystem.minor %>/]]></media_url>
<name>systemsmanagement_puppet</name>
<product>systemsmanagement_puppet</product>
<product_dir>/</product_dir>
<signature-handling>
<accept_non_trusted_gpg_key>
<all config:type="boolean">false</all>
<keys config:type="list">
<keyid>2ABFA143A0E46E11</keyid>
</keys>
</accept_non_trusted_gpg_key>
<import_gpg_key>
<all config:type="boolean">false</all>
<keys config:type="list">
<keyid>2ABFA143A0E46E11</keyid>
</keys>
</import_gpg_key>
</signature-handling>
</listentry>
</add_on_products>
</add-on>
</profile>
app/views/unattended/gpxe_kickstart_config.erb
#!gpxe
kernel <%= "#{@host.url_for_boot(:kernel)}" %> ks=<%= foreman_url("provision")%>?static=yes ksdevice=<%= @host.mac %> network kssendmac ip=${net0/ip} netmask=${net0/netmask} gateway=${net0/gateway} dns=${net0/dns}
initrd <%= "#{@host.url_for_boot(:initrd)}" %>
boot
app/views/unattended/grubby.erb
#!/bin/bash
KERNEL="/boot/kernel"
INITRD="/boot/initrd.img"
wget -O "$KERNEL" "<%= @host.url_for_boot(:kernel) %>"
wget -O "$INITRD" "<%= @host.url_for_boot(:initrd) %>"
grubby --add-kernel=$KERNEL --initrd=$INITRD --copy-default --title "<%= @host.operatingsystem %>" --make-default --args="ks=<%= foreman_url("provision")%>"
app/views/unattended/jumpstart.erb
install_type <%= @install_type %>
partitioning explicit
<%= @disk %>
<% if @host.use_image -%>
archive_location nfs <%=@archive_location%>
<% else -%>
system_type <%= @system_type %>
package <%= @packages %> add
cluster <%= @cluster %>
<% end -%>
app/views/unattended/jumpstart/PXEGrub.erb
<%#
kind: PXEGrub
name: Community Jumpstart PXEGrub
%>
default=0
timeout=10
title Solaris_10 Jumpstart
kernel <%= multiboot %> kernel/unix - install dhcp nowin -B install_config=<%= jumpstart_path %>,sysid_config=<%= jumpstart_path %>/sysidcfg/sysidcfg_primary,install_media=<%= install_path %>,install_boot=<%= install_path %>/boot
module <%= miniroot %>
title Solaris 10
findroot (rootfs0,0,a)
kernel$ /platform/i86pc/multiboot
module /platform/i86pc/boot_archive
app/views/unattended/jumpstart/disklayout.erb
<%#
kind: ptable
name: Community Jumpstart Disk
%>
filesys c0t0d0s0 7000 /
filesys c0t0d0s1 1000 swap
filesys c0t0d0s3 15 unnamed
filesys c0t0d0s7 free /tmp2
app/views/unattended/jumpstart/disklayout_mirrored.erb
<%#
kind: ptable
name: Community Jumpstart Mirrored Disk
%>
filesys mirror:d10 c1t0d0s0 c1t1d0s0 16000 /
filesys mirror:d20 c1t0d0s1 c1t1d0s1 8000 swap
filesys mirror:d40 c1t0d0s4 c1t1d0s4 free /var/tmp
metadb c1t0d0s7 size 8192 count 3
metadb c1t1d0s7 size 8192 count 3
app/views/unattended/jumpstart/finish.erb
<%#
kind: finish
name: Community Jumpstart Finish
%>
logger "Starting finish script"
# Do not turn the machine off after 30 minutes. Very annoying!
/bin/touch /noautoshutdown
# Install the root password
/usr/bin/perl -p -i -e 's/^root:[^:]+/root:<%= @host.root_pass.gsub("/", '\/')-%>/' /etc/shadow
# Root can ssh into this box. This is very useful while we rebuild this
/usr/bin/perl -p -i -e "s/PermitRootLogin no/PermitRootLogin yes/" /etc/ssh/sshd_config
# Now ensure that we have the newest puppet and facter installed
mount /proc
/usr/bin/cat /etc/mnttab | sed -e 's/\/a/\//' | sed -e 's/\/a//' > /a/etc/mnttab
/sbin/mount -F mntfs mnttab /etc/mnttab
/usr/sbin/mknod /devices/pseudo/random@0:random c 190 0
/usr/sbin/mknod /devices/pseudo/random@0:urandom c 190 1
/usr/sbin/pkgadd -a /tmp/admin -d http://get.opencsw.org/now all
/opt/csw/bin/pkgutil -U -y
/opt/csw/bin/pkgutil -u -f -y CSWfacter CSWpuppet CSWwget
/usr/bin/echo "Creating helper startup script to start puppet"
ONETIME=S99.enable.puppet
/usr/bin/cat > /etc/rc3.d/$ONETIME << EOF
#!/bin/sh
#
# $ONETIME
#
# runs once at startup and then removes itself.
#
PATH=/usr/bin:/usr/sbin; export PATH
/usr/sbin/svccfg import /var/opt/csw/svc/manifest/network/cswpuppetd.xml
/usr/sbin/svcadm enable svc:/network/cswpuppetd
sleep 2
rm \$0
EOF
/usr/bin/echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippet "puppet.conf" -%>
EOF
# The x86 version of the puppet package ignores the --config parameter. This should fix that and not hurt other installations
if [ -f /etc/opt/csw/puppet/puppetd.conf ]
then
rm -f /etc/opt/csw/puppet/puppetd.conf
ln -s /etc/puppet/puppet.conf /etc/opt/csw/puppet/puppetd.conf
fi
/opt/csw/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server puppet --no-daemonize
echo "Informing Foreman that we are built"
/opt/csw/bin/wget --no-check-certificate -O /dev/null <%= foreman_url %>
exit 0
app/views/unattended/jumpstart/provision.erb
<%#
kind: provision
name: Community Jumpstart
%>
install_type <%= @install_type %>
partitioning explicit
<%= @disk %>
<% if @host.use_image -%>
archive_location nfs <%=@archive_location%>
<% else -%>
system_type <%= @system_type %>
package <%= @packages %> add
cluster <%= @cluster %>
<% end -%>
app/views/unattended/jumpstart_finish.erb
logger "Starting finish script"
# Do not turn the machine off after 30 minutes. Very annoying!
/bin/touch /noautoshutdown
# Install the root password
/usr/bin/perl -p -i -e 's/^root:[^:]+/root:<%= @host.root_pass.gsub("/", '\/')-%>/' /etc/shadow
# Root can ssh into this box. This is very useful while we rebuild this
/usr/bin/perl -p -i -e "s/PermitRootLogin no/PermitRootLogin yes/" /etc/ssh/sshd_config
# Now ensure that we have the newest puppet and facter installed
mount /proc
/usr/bin/cat /etc/mnttab | sed -e 's/\/a/\//' | sed -e 's/\/a//' > /a/etc/mnttab
/sbin/mount -F mntfs mnttab /etc/mnttab
/usr/sbin/mknod /devices/pseudo/random@0:random c 190 0
/usr/sbin/mknod /devices/pseudo/random@0:urandom c 190 1
/usr/sbin/pkgadd -a /tmp/admin -d http://get.opencsw.org/now all
/opt/csw/bin/pkgutil -U -y
/opt/csw/bin/pkgutil -u -f -y CSWfacter CSWpuppet CSWwget
/usr/bin/echo "Creating helper startup script to start puppet"
ONETIME=S99.enable.puppet
/usr/bin/cat > /etc/rc3.d/$ONETIME << EOF
#!/bin/sh
#
# $ONETIME
#
# runs once at startup and then removes itself.
#
PATH=/usr/bin:/usr/sbin; export PATH
/usr/sbin/svccfg import /var/opt/csw/svc/manifest/network/cswpuppetd.xml
/usr/sbin/svcadm enable svc:/network/cswpuppetd
sleep 2
rm \$0
EOF
/usr/bin/echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippets "puppet.conf" -%>
EOF
# The x86 version of the puppet package ignores the --config parameter. This should fix that and not hurt other installations
if [ -f /etc/opt/csw/puppet/puppetd.conf ]
then
rm -f /etc/opt/csw/puppet/puppetd.conf
ln -s /etc/puppet/puppet.conf /etc/opt/csw/puppet/puppetd.conf
fi
/opt/csw/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server puppet --no-daemonize
echo "Informing Foreman that we are built"
/opt/csw/bin/wget --no-check-certificate -O /dev/null <%= foreman_url %>
exit 0
app/views/unattended/kickstart.erb
#kind: provision
#name: Community Kickstart
#oses:
#- CentOS 5
#- CentOS 6
#- Fedora 16
#- Fedora 17
#- Fedora 18
#- Fedora 19
install
<%= @mediapath %>
lang en_US.UTF-8
selinux --permissive
keyboard us
skipx
network --bootproto <%= @static ? "static" : "dhcp" %> --hostname <%= @host %>
rootpw --iscrypted <%= root_pass %>
firewall --<%= @host.operatingsystem.major.to_i >= 6 ? "service=" : "" %>ssh
authconfig --useshadow --passalgo=sha256 --kickstart
timezone UTC
services --disabled autofs,gpm,sendmail,cups,iptables,ip6tables,auditd,arptables_jf,xfs,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd,restorecond,mcstrans,rhnsd,yum-updatesd
<% if @host.operatingsystem.name == "Fedora" -%>
repo --name=fedora-everything --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-<%= @host.operatingsystem.major %>&arch=<%= @host.architecture %>
<% elsif @host.operatingsystem.family == "Redhat" %>
repo --name="Extra Packages for Enterprise Linux" --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-<%= @host.operatingsystem.major %>&arch=<%= @host.architecture %>
<% end -%>
<% if @host.operatingsystem.name == "Fedora" and @host.operatingsystem.major.to_i <= 16 -%>
# Bootloader exception for Fedora 16:
bootloader --append="nofb quiet splash=quiet <%=ks_console%>" <%= grub_pass %>
part biosboot --fstype=biosboot --size=1
<% else -%>
bootloader --location=mbr --append="nofb quiet splash=quiet" <%= grub_pass %>
<% end -%>
<% if @dynamic -%>
%include /tmp/diskpart.cfg
<% else -%>
<%= @host.diskLayout %>
<% end -%>
text
reboot
%packages --ignoremissing
yum
dhclient
ntp
wget
@Core
epel-release
puppet
<%= "%end\n" if @host.operatingsystem.name == "Fedora" %>
<% if @dynamic -%>
%pre
<%= @host.diskLayout %>
<% end -%>
%post --nochroot
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
<%= "%end\n" if @host.operatingsystem.name == "Fedora" %>
%post
logger "Starting anaconda <%= @host %> postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub <%= @host.params["ntp-server"] || "0.fedora.pool.ntp.org" %>
/usr/sbin/hwclock --systohc
# update all the base packages from the updates repository
yum -t -y -e 0 update
echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippets "puppet.conf" %>
EOF
# Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
sync
# Inform the build system that we are done.
echo "Informing Foreman that we are built"
wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
# Sleeping an hour for debug
) 2>&1 | tee /root/install.post.log
exit 0
<%= "%end\n" if @host.operatingsystem.name == "Fedora" -%>
app/views/unattended/kickstart/PXELinux.erb
<%#
kind: PXELinux
name: Community Kickstart PXE
oses:
- CentOS 5
- CentOS 6
- Fedora 16
- Fedora 17
- Fedora 18
- Fedora 19
- RedHat 5
- RedHat 6
%>
default linux
label linux
kernel <%= @kernel %>
<% if @host.operatingsystem.name == "Fedora" and @host.operatingsystem.major.to_i > 16 -%>
append initrd=<%= @initrd %> ks=<%= foreman_url("provision")%> ks.device=bootif network ks.sendmac
<% else -%>
append initrd=<%= @initrd %> ks=<%= foreman_url("provision")%> ksdevice=bootif network kssendmac
<% end -%>
IPAPPEND 2
app/views/unattended/kickstart/disklayout.erb
<%#
kind: ptable
name: Community Kickstart Disklayout
oses:
- CentOS 5
- CentOS 6
- Fedora 16
- Fedora 17
- Fedora 18
- Fedora 19
- RedHat 5
- RedHat 6
%>
zerombr
clearpart --all --initlabel
autopart
app/views/unattended/kickstart/iPXE.erb
#!gpxe
<%#
kind: iPXE
name: Community Kickstart iPXE
oses:
- CentOS 5
- CentOS 6
- Fedora 16
- Fedora 17
- Fedora 18
- Fedora 19
- RedHat 5
- RedHat 6
%>
kernel <%= "#{@host.url_for_boot(:kernel)}" %> ks=<%= foreman_url("provision")%>?static=yes ksdevice=<%= @host.mac %> network kssendmac ip=${netX/ip} netmask=${netX/netmask} gateway=${netX/gateway} dns=${dns}
initrd <%= "#{@host.url_for_boot(:initrd)}" %>
boot
app/views/unattended/kickstart/provision.erb
<%#
kind: provision
name: Community Kickstart
oses:
- CentOS 5
- CentOS 6
- Fedora 16
- Fedora 17
- Fedora 18
- Fedora 19
%>
install
<%= @mediapath %>
lang en_US.UTF-8
selinux --enforcing
keyboard us
skipx
network --bootproto <%= @static ? "static --ip=#{@host.ip} --netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway} --nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n| n.blank?}.join(',')}" : "dhcp" %> --hostname <%= @host %>
rootpw --iscrypted <%= root_pass %>
firewall --<%= @host.operatingsystem.major.to_i >= 6 ? "service=" : "" %>ssh
authconfig --useshadow --passalgo=sha256 --kickstart
timezone UTC
services --disabled autofs,gpm,sendmail,cups,iptables,ip6tables,auditd,arptables_jf,xfs,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd,restorecond,mcstrans,rhnsd,yum-updatesd
<% if @host.operatingsystem.name == "Fedora" -%>
repo --name=fedora-everything --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-<%= @host.operatingsystem.major %>&arch=<%= @host.architecture %>
<% if @host.params['enable-puppetlabs-repo'] && @host.params['enable-puppetlabs-repo'] == 'true' -%>
repo --name=puppetlabs-products --baseurl=http://yum.puppetlabs.com/fedora/f<%= @host.operatingsystem.major %>/products/<%= @host.architecture %>
repo --name=puppetlabs-deps --baseurl=http://yum.puppetlabs.com/fedora/f<%= @host.operatingsystem.major %>/dependencies/<%= @host.architecture %>
<% end -%>
<% elsif @host.operatingsystem.family == "Redhat" %>
repo --name="Extra Packages for Enterprise Linux" --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-<%= @host.operatingsystem.major %>&arch=<%= @host.architecture %>
<% if @host.params['enable-puppetlabs-repo'] && @host.params['enable-puppetlabs-repo'] == 'true' -%>
repo --name=puppetlabs-products --baseurl=http://yum.puppetlabs.com/el/<%= @host.operatingsystem.major %>/products/<%= @host.architecture %>
repo --name=puppetlabs-deps --baseurl=http://yum.puppetlabs.com/el/<%= @host.operatingsystem.major %>/dependencies/<%= @host.architecture %>
<% end -%>
<% end -%>
<% if @host.operatingsystem.name == "Fedora" and @host.operatingsystem.major.to_i <= 16 -%>
# Bootloader exception for Fedora 16:
bootloader --append="nofb quiet splash=quiet <%=ks_console%>" <%= grub_pass %>
part biosboot --fstype=biosboot --size=1
<% else -%>
bootloader --location=mbr --append="nofb quiet splash=quiet" <%= grub_pass %>
<% end -%>
<% if @dynamic -%>
%include /tmp/diskpart.cfg
<% else -%>
<%= @host.diskLayout %>
<% end -%>
text
reboot
%packages --ignoremissing
yum
dhclient
ntp
wget
@Core
epel-release
puppet
<% if @host.params['enable-puppetlabs-repo'] && @host.params['enable-puppetlabs-repo'] == 'true' -%>
puppetlabs-release
<% end -%>
<%= "%end\n" if @host.operatingsystem.name == "Fedora" %>
<% if @dynamic -%>
%pre
<%= @host.diskLayout %>
<% end -%>
%post --nochroot
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
<%= "%end\n" if @host.operatingsystem.name == "Fedora" %>
%post
logger "Starting anaconda <%= @host %> postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub <%= @host.params["ntp-server"] || "0.fedora.pool.ntp.org" %>
/usr/sbin/hwclock --systohc
# update all the base packages from the updates repository
yum -t -y -e 0 update
echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippet "puppet.conf" %>
EOF
# Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
sync
# Inform the build system that we are done.
echo "Informing Foreman that we are built"
wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
# Sleeping an hour for debug
) 2>&1 | tee /root/install.post.log
exit 0
<%= "%end\n" if @host.operatingsystem.name == "Fedora" -%>
app/views/unattended/kickstart/provision_rhel.erb
<%#
kind: provision
name: Community Kickstart RHEL
oses:
- RedHat 5
- RedHat 6
%>
install
<%= @mediapath %>
lang en_US.UTF-8
selinux --enforcing
keyboard us
skipx
network --bootproto <%= @static ? "static --ip=#{@host.ip} --netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway} --nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n| n.blank?}.join(',')}" : "dhcp" %> --hostname <%= @host %>
rootpw --iscrypted <%= root_pass %>
firewall --<%= @host.operatingsystem.major.to_i >= 6 ? "service=" : "" %>ssh
authconfig --useshadow --passalgo=sha256 --kickstart
timezone UTC
services --disabled autofs,gpm,sendmail,cups,iptables,ip6tables,auditd,arptables_jf,xfs,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd,restorecond,mcstrans,rhnsd,yum-updatesd
repo --name="Extra Packages for Enterprise Linux" --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-<%= @host.operatingsystem.major %>&arch=<%= @host.architecture %>
<% if @host.params['enable-puppetlabs-repo'] && @host.params['enable-puppetlabs-repo'] == 'true' -%>
repo --name=puppetlabs-products --baseurl=http://yum.puppetlabs.com/el/<%= @host.operatingsystem.major %>/products/<%= @host.architecture %>
repo --name=puppetlabs-deps --baseurl=http://yum.puppetlabs.com/el/<%= @host.operatingsystem.major %>/dependencies/<%= @host.architecture %>
<% end -%>
bootloader --location=mbr --append="nofb quiet splash=quiet" <%= grub_pass %>
key --skip
<% if @dynamic -%>
%include /tmp/diskpart.cfg
<% else -%>
<%= @host.diskLayout %>
<% end -%>
text
reboot
%packages --ignoremissing
yum
dhclient
ntp
wget
@Core
epel-release
puppet
<% if @host.params['enable-puppetlabs-repo'] && @host.params['enable-puppetlabs-repo'] == 'true' -%>
puppetlabs-release
<% end -%>
<% if @dynamic -%>
%pre
<%= @host.diskLayout %>
<% end -%>
%post --nochroot
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
%post
logger "Starting anaconda <%= @host %> postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub <%= @host.params["ntp-server"] || "0.fedora.pool.ntp.org" %>
/usr/sbin/hwclock --systohc
<%= snippet "redhat_register" %>
# update all the base packages from the updates repository
yum -t -y -e 0 update
# and add the puppet package
yum -t -y -e 0 install puppet
echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippet "puppet.conf" %>
EOF
# Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
sync
# Inform the build system that we are done.
echo "Informing Foreman that we are built"
wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
# Sleeping an hour for debug
) 2>&1 | tee /root/install.post.log
exit 0
app/views/unattended/kickstart_rhel.erb
#kind: provision
#name: Community Kickstart RHEL
#oses:
#- RedHat 5
#- RedHat 6
install
<%= @mediapath %>
lang en_US.UTF-8
selinux --permissive
keyboard us
skipx
network --bootproto <%= @static ? "static" : "dhcp" %> --hostname <%= @host %>
rootpw --iscrypted <%= root_pass %>
firewall --<%= @host.operatingsystem.major.to_i >= 6 ? "service=" : "" %>ssh
authconfig --useshadow --passalgo=sha256 --kickstart
timezone UTC
services --disabled autofs,gpm,sendmail,cups,iptables,ip6tables,auditd,arptables_jf,xfs,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd,restorecond,mcstrans,rhnsd,yum-updatesd
repo --name="Extra Packages for Enterprise Linux" --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-<%= @host.operatingsystem.major %>&arch=<%= @host.architecture %>
bootloader --location=mbr --append="nofb quiet splash=quiet" <%= grub_pass %>
key --skip
<% if @dynamic -%>
%include /tmp/diskpart.cfg
<% else -%>
<%= @host.diskLayout %>
<% end -%>
text
reboot
%packages --ignoremissing
yum
dhclient
ntp
wget
@Core
epel-release
puppet
<% if @dynamic -%>
%pre
<%= @host.diskLayout %>
<% end -%>
%post --nochroot
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
%post
logger "Starting anaconda <%= @host %> postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub <%= @host.params["ntp-server"] || "0.fedora.pool.ntp.org" %>
/usr/sbin/hwclock --systohc
<%= snippets "redhat_register" %>
# update all the base packages from the updates repository
yum -t -y -e 0 update
# and add the puppet package
yum -t -y -e 0 install puppet
echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippets "puppet.conf" %>
EOF
# Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
sync
# Inform the build system that we are done.
echo "Informing Foreman that we are built"
wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
# Sleeping an hour for debug
) 2>&1 | tee /root/install.post.log
exit 0
app/views/unattended/preseed.erb
#kind: provision
#name: Community Preseed
#oses:
#- Debian 6.0
#- Debian 7.0
#- Ubuntu 10.04
#- Ubuntu 12.04
#- Ubuntu 13.04
# Locale, country and keyboard settings
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/modelcode string pc105
d-i console-setup/variant USA
d-i console-setup/layout USA
d-i console-setup/layoutcode string us
<% if @host.operatingsystem.name == "Debian" && @host.operatingsystem.major.to_i >= 7 -%>
d-i keymap select us
<% end -%>
# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string <%= @host %>
d-i netcfg/get_domain string <%= @host.domain %>
d-i netcfg/wireless_wep string
d-i hw-detect/load_firmware boolean true
# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string <%= @preseed_server %>
d-i mirror/http/directory string <%= @preseed_path %>
d-i mirror/http/proxy string
d-i mirror/codename string <%= @host.operatingsystem.release_name %>
d-i mirror/suite string <%= @host.operatingsystem.release_name %>
d-i mirror/udeb/suite string <%= @host.operatingsystem.release_name %>
# Time settings
d-i clock-setup/utc boolean true
<% if @host.params['time-zone'] -%>
d-i time/zone string <%= @host.params['time-zone'] %>
<% else -%>
d-i time/zone string UTC
<% end -%>
# NTP
d-i clock-setup/ntp boolean true
# Set alignment for automatic partitioning
# Choices: cylinder, minimal, optimal
#d-i partman/alignment select cylinder
<%= @host.diskLayout %>
# Install different kernel
#d-i base-installer/kernel/image string linux-server
# User settings
d-i passwd/root-password-crypted password <%= root_pass %>
user-setup-udeb passwd/root-login boolean true
d-i passwd passwd/make-user boolean false
user-setup-udeb passwd/make-user boolean false
<% if @host.params['enable-puppetlabs-repo'] && @host.params['enable-puppetlabs-repo'] == 'true' -%>
# Puppetlabs products
d-i apt-setup/local0/repository string \
http://apt.puppetlabs.com <%= @host.operatingsystem.release_name %> main
d-i apt-setup/local0/comment string Puppetlabs products
d-i apt-setup/local0/source boolean true
d-i apt-setup/local0/key string http://apt.puppetlabs.com/pubkey.gpg
# Puppetlabs dependencies
d-i apt-setup/local1/repository string \
http://apt.puppetlabs.com <%= @host.operatingsystem.release_name %> dependencies
d-i apt-setup/local1/comment string Puppetlabs dependencies
d-i apt-setup/local1/source boolean true
d-i apt-setup/local1/key string http://apt.puppetlabs.com/pubkey.gpg
<% end -%>
# Install minimal task set (see tasksel --task-packages minimal)
tasksel tasksel/first multiselect minimal
<% if @host.operatingsystem.name == "Ubuntu" and @host.operatingsystem.major.to_i == 10 -%>
<% puppet_package = "puppet/lucid-backports" -%>
d-i apt-setup/backports boolean true
<% else -%>
<% puppet_package = "puppet" -%>
<% end -%>
# Install some base packages
d-i pkgsel/include string <%= puppet_package %> lsb-release openssh-server
d-i pkgsel/update-policy select unattended-upgrades
popularity-contest popularity-contest/participate boolean false
# Boot loader settings
#grub-pc grub-pc/hidden_timeout boolean false
#grub-pc grub-pc/timeout string 10
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note
d-i preseed/late_command string wget <%= foreman_url("finish") %> -O /target/tmp/finish.sh && in-target chmod +x /tmp/finish.sh && in-target /tmp/finish.sh
app/views/unattended/preseed/PXELinux.erb
<%#
kind: PXELinux
name: Community Preseed PXE
oses:
- Debian 6.0
- Debian 7.0
- Ubuntu 10.04
- Ubuntu 12.04
- Ubuntu 13.04
%>
<% if @host.operatingsystem.name == "Debian" -%>
<% keyboard_params = "auto=true console-keymaps-at/keymap=us keymap=us domain=#{@host.domain}" -%>
<% else -%>
<% keyboard_params = "console-setup/ask_detect=false console-setup/layout=USA console-setup/variant=USA keyboard-configuration/layoutcode=us" -%>
<% end -%>
default linux
label linux
kernel <%= @kernel %>
append initrd=<%= @initrd %> interface=auto url=<%= foreman_url("provision")%> ramdisk_size=10800 root=/dev/rd/0 rw auto hostname=<%= @host.name %> <%= keyboard_params %> locale=en_US
IPAPPEND 2
app/views/unattended/preseed/disklayout.erb
<%#
kind: ptable
name: Community Preseed Disklayout
oses:
- Debian 6.0
- Debian 7.0
- Ubuntu 10.04
- Ubuntu 12.04
- Ubuntu 13.04
%>
<% if @host.params['install-disk'] -%>
d-i partman-auto/disk string <%= @host.params['install-disk'] %>
<% else -%>
d-i partman-auto/disk string /dev/sda /dev/vda
<% end -%>
### Partitioning
# The presently available methods are: "regular", "lvm" and "crypto"
<% if @host.params['partitioning-method'] -%>
d-i partman-auto/method string <%= @host.params['partitioning-method'] %>
<% else -%>
d-i partman-auto/method string regular
<% end -%>
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
<% if @host.params['partitioning-method'] && @host.params['partitioning-method'] == 'lvm' -%>
# For LVM partitioning, you can select how much of the volume group to use
# for logical volumes.
d-i partman-auto-lvm/guided_size string max
<% end -%>
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home partition
# - multi: separate /home, /usr, /var, and /tmp partitions
<% if @host.params['partitioning-recipe'] -%>
d-i partman-auto/choose_recipe select <%= @host.params['partitioning-recipe'] %>
<% else -%>
d-i partman-auto/choose_recipe select atomic
<% end -%>
# If you just want to change the default filesystem from ext3 to something
# else, you can do that without providing a full recipe.
<% if @host.params['partitioning-filesystem'] -%>
d-i partman/default_filesystem string <%= @host.params['partitioning-filesystem'] %>
<% end %>
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff