Project

General

Profile

« Previous | Next » 

Revision f1627da8

Added by Dominic Cleal over 10 years ago

templates - sync from community-templates

View differences:

app/views/unattended/autoyast/disklayout_lvm.erb
<%#
kind: ptable
name: Community AutoYaST LVM
%>
<partitioning config:type="list">
<drive>
<device>/dev/sda</device>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">ext3</filesystem>
<format config:type="boolean">true</format>
<mount>/boot</mount>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<size>1G</size>
<stripes config:type="integer">1</stripes>
<stripesize config:type="integer">4</stripesize>
<subvolumes config:type="list"/>
</partition>
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">false</format>
<lvm_group>vg00</lvm_group>
<partition_id config:type="integer">142</partition_id>
<partition_nr config:type="integer">2</partition_nr>
<size>max</size>
</partition>
</partitions>
<pesize></pesize>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
</drive>
<drive>
<device>/dev/vg00</device>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">ext3</filesystem>
<format config:type="boolean">true</format>
<lv_name>root</lv_name>
<mount>/</mount>
<size>4G</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">swap</filesystem>
<format config:type="boolean">true</format>
<lv_name>swap</lv_name>
<mount>swap</mount>
<size>8G</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">ext3</filesystem>
<format config:type="boolean">true</format>
<lv_name>usr</lv_name>
<mount>/usr</mount>
<size>8G</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">ext3</filesystem>
<format config:type="boolean">true</format>
<lv_name>tmp</lv_name>
<mount>/tmp</mount>
<size>4G</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">ext3</filesystem>
<format config:type="boolean">true</format>
<lv_name>var</lv_name>
<mount>/var</mount>
<size>4G</size>
</partition>
</partitions>
<type config:type="symbol">CT_LVM</type>
<use>all</use>
</drive>
</partitioning>
app/views/unattended/autoyast/provision.erb
kind: provision
name: Community AutoYaST
%>
<%
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.params['force-puppet']
%>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general>
......
<software>
<base>default</base>
<packages config:type="list">
<% if puppet_enabled %>
<package>puppet</package>
<% end -%>
<package>wget</package>
</packages>
</software>
......
<notification>Setting up Puppet / Foreman ...</notification>
<debug config:type="boolean">true</debug>
<source><![CDATA[
<% if puppet_enabled %>
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
/usr/bin/sed -ie s/^PUPPET_SERVER=.*/PUPPET_SERVER=<%= @host.puppetmaster.blank? ? "" : @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 %>
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag <%= @host.puppetmaster.blank? ? "" : "--server #{@host.puppetmaster}" %> --no-daemonize
/sbin/chkconfig puppet on -f
<% end -%>
/usr/bin/wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
]]>
</source>
</script>
......
</keyboard>
<timezone>
<hwclock>UTC</hwclock>
<timezone>Etc/UTC</timezone>
<timezone><%= @host.params["time-zone"] || "Etc/UTC" %></timezone>
</timezone>
</profile>
app/views/unattended/autoyast/provision_sles.erb
oses:
- SLES 11
%>
<%
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.params['force-puppet']
%>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general>
......
<software>
<base>default</base>
<packages config:type="list">
<% if puppet_enabled %>
<package>puppet</package>
<package>wget</package>
<package>rubygem-ruby-augeas</package>
<% end -%>
<package>wget</package>
</packages>
</software>
<users config:type="list">
......
<notification>Setting up Puppet / Foreman ...</notification>
<debug config:type="boolean">true</debug>
<source><![CDATA[
<% if puppet_enabled %>
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
/usr/bin/sed -ie s/^PUPPET_SERVER=.*/PUPPET_SERVER=<%= @host.puppetmaster.blank? ? "" : @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 %>
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag <%= @host.puppetmaster.blank? ? "" : "--server #{@host.puppetmaster}" %> --no-daemonize
/sbin/chkconfig puppet on -f
<% end -%>
/usr/bin/wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
]]>
</source>
</script>
......
</keyboard>
<timezone>
<hwclock>UTC</hwclock>
<timezone>Etc/UTC</timezone>
<timezone><%= @host.params["time-zone"] || "Etc/UTC" %></timezone>
</timezone>
<add-on>
<add_on_products config:type="list">
......
<product_dir>/</product_dir>
<name>SuSE-Linux-SDK</name>
</listentry>
<% if puppet_enabled %>
<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>
......
</import_gpg_key>
</signature-handling>
</listentry>
<% end -%>
</add_on_products>
</add-on>
</profile>
app/views/unattended/jumpstart/finish.erb
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
/opt/csw/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %> --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/PXELinux.erb
kind: PXELinux
name: Community Kickstart PXE
oses:
- CentOS 4
- CentOS 5
- CentOS 6
- CentOS 7
- Fedora 16
- Fedora 17
- Fedora 18
- Fedora 19
- RedHat 4
- RedHat 5
- RedHat 6
- RedHat 7
%>
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
<% elsif @host.operatingsystem.name != "Fedora" and @host.operatingsystem.major.to_i >= 7 -%>
append initrd=<%= @initrd %> ks=<%= foreman_url("provision")%> network ks.sendmac
<% else -%>
append initrd=<%= @initrd %> ks=<%= foreman_url("provision")%> ksdevice=bootif network kssendmac
<% end -%>
app/views/unattended/kickstart/disklayout.erb
zerombr
clearpart --all --initlabel
autopart
app/views/unattended/kickstart/iPXE.erb
- RedHat 6
%>
<%# This template will not function with Safemode set to true.
Please disable it in Settings > Provisioning %>
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)}" %>
app/views/unattended/kickstart/provision.erb
kind: provision
name: Community Kickstart
oses:
- CentOS 4
- CentOS 5
- CentOS 6
- CentOS 7
- Fedora 16
- Fedora 17
- Fedora 18
- Fedora 19
%>
<%
rhel_compatible = @host.operatingsystem.family == "Redhat" && @host.operatingsystem.name != "Fedora"
os_major = @host.operatingsystem.major.to_i
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.params['force-puppet']
%>
install
<%= @mediapath %>
lang en_US.UTF-8
......
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
firewall --<%= os_major >= 6 ? "service=" : "" %>ssh
authconfig --useshadow --passalgo=sha256 --kickstart
timezone UTC
timezone <%= @host.params["time-zone"] || "UTC" %>
<% if rhel_compatible && os_major > 4 -%>
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
<% end -%>
<% 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' -%>
<% if puppet_enabled && @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" %>
<% elsif rhel_compatible && os_major > 4 -%>
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' -%>
<% if puppet_enabled && @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 -%>
<% if @host.operatingsystem.name == "Fedora" and os_major <= 16 -%>
# Bootloader exception for Fedora 16:
bootloader --append="nofb quiet splash=quiet <%=ks_console%>" <%= grub_pass %>
part biosboot --fstype=biosboot --size=1
......
wget
@Core
epel-release
<% if puppet_enabled %>
puppet
<% if @host.params['enable-puppetlabs-repo'] && @host.params['enable-puppetlabs-repo'] == 'true' -%>
puppetlabs-release
<% end -%>
<%= "%end\n" if @host.operatingsystem.name == "Fedora" %>
<% end -%>
%end
<% if @dynamic -%>
%pre
<%= @host.diskLayout %>
%end
<% end -%>
%post --nochroot
......
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" %>
%end
%post
logger "Starting anaconda <%= @host %> postinstall"
......
# update all the base packages from the updates repository
yum -t -y -e 0 update
<% if puppet_enabled %>
echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippet "puppet.conf" %>
......
# 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
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag <%= @host.puppetmaster.blank? ? "" : "--server #{@host.puppetmaster}" %> --no-daemonize
<% end -%>
sync
......
) 2>&1 | tee /root/install.post.log
exit 0
<%= "%end\n" if @host.operatingsystem.name == "Fedora" -%>
%end
app/views/unattended/kickstart/provision_rhel.erb
kind: provision
name: Community Kickstart RHEL
oses:
- RedHat 4
- RedHat 5
- RedHat 6
- RedHat 7
%>
<%
os_major = @host.operatingsystem.major.to_i
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.params['force-puppet']
%>
install
<%= @mediapath %>
......
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
firewall --<%= os_major >= 6 ? "service=" : "" %>ssh
authconfig --useshadow --passalgo=sha256 --kickstart
timezone UTC
timezone <%= @host.params["time-zone"] || "UTC" %>
<% if os_major > 4 -%>
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' -%>
<% if puppet_enabled && @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 -%>
bootloader --location=mbr --append="nofb quiet splash=quiet" <%= grub_pass %>
<% if os_major == 5 -%>
key --skip
<% end -%>
<% if @dynamic -%>
%include /tmp/diskpart.cfg
......
wget
@Core
epel-release
<% if puppet_enabled %>
puppet
<% if @host.params['enable-puppetlabs-repo'] && @host.params['enable-puppetlabs-repo'] == 'true' -%>
puppetlabs-release
<% end -%>
<% end -%>
%end
<% if @dynamic -%>
%pre
<%= @host.diskLayout %>
%end
<% end -%>
%post --nochroot
......
cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
%end
%post
logger "Starting anaconda <%= @host %> postinstall"
......
# update all the base packages from the updates repository
yum -t -y -e 0 update
<% if puppet_enabled %>
# and add the puppet package
yum -t -y -e 0 install puppet
......
# 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
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag <%= @host.puppetmaster.blank? ? "" : "--server #{@host.puppetmaster}" %> --no-daemonize
<% end -%>
sync
......
# Sleeping an hour for debug
) 2>&1 | tee /root/install.post.log
exit 0
%end
app/views/unattended/kickstart/userdata.erb
<%#
kind: user_data
name: Community Kickstart UserData
oses:
- CentOS 4
- CentOS 5
- CentOS 6
- CentOS 7
- Fedora 16
- Fedora 17
- Fedora 18
- Fedora 19
%>
#!/bin/bash
<%# Cloud instances frequently have incorrect hosts data %>
<%= snippet "fix_hosts" %>
<%
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.params['force-puppet']
%>
<% if puppet_enabled %>
yum install -y 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 --onetime --tags no_such_tag <%= @host.puppetmaster.blank? ? "" : "--server #{@host.puppetmaster}" %> --no-daemonize
<% end -%>
# UserData still needs wget to mark as finished
/usr/bin/wget --quiet --output-document=/dev/null --no-check-certificate <%= foreman_url('built') %>
app/views/unattended/preseed/finish.erb
- Ubuntu 12.04
- Ubuntu 13.04
%>
<%
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.params['force-puppet']
%>
<% if puppet_enabled %>
cat > /etc/puppet/puppet.conf << EOF
<%= snippet "puppet.conf" %>
EOF
/bin/sed -i 's/^START=no/START=yes/' /etc/default/puppet
/bin/touch /etc/puppet/namespaceauth.conf
/usr/bin/puppet agent --config /etc/puppet/puppet.conf --onetime --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
/bin/touch /etc/puppet/namespaceauth.conf
/usr/bin/puppet agent --config /etc/puppet/puppet.conf --onetime --tags no_such_tag <%= @host.puppetmaster.blank? ? "" : "--server #{@host.puppetmaster}" %> --no-daemonize
<% end -%>
/usr/bin/wget --quiet --output-document=/dev/null --no-check-certificate <%= foreman_url %>
app/views/unattended/preseed/iPXE.erb
#!gpxe
<%#
kind: iPXE
name: Community Preseed iPXE
oses:
- Debian 6.0
- Debian 7.0
- Ubuntu 12.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 -%>
<% kernel, initrd = @host.operatingsystem.boot_files_uri(@host.medium,@host.architecture) -%>
<% static = @host.token.nil? ? '?static=yes' : '&static=yes' -%>
<%# This template will not function with Safemode set to true.
Please disable it in Settings > Provisioning %>
kernel <%= kernel %> interface=auto url=<%= foreman_url("provision")%><%= static %> ramdisk_size=10800 root=/dev/rd/0 rw auto netcfg/disable_dhcp=true BOOTIF=${netX/mac} hostname=<%= @host.name %> <%= keyboard_params %> locale=en_US netcfg/get_ipaddress=${netX/ip} netcfg/get_netmask=${netX/netmask} netcfg/get_gateway=${netX/gateway} netcfg/get_nameservers=${dns} netcfg/confirm_static=true
initrd <%= initrd %>
boot
app/views/unattended/preseed/provision.erb
- Ubuntu 12.04
- Ubuntu 13.04
%>
<%
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.params['force-puppet']
%>
# Locale, country and keyboard settings
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
......
d-i keymap select us
<% end -%>
<% if @static -%>
# Static network configuration.
d-i netcfg/disable_dhcp boolean true
d-i netcfg/get_ipaddress string <%= @host.ip %>
d-i netcfg/get_netmask string <%= @host.subnet.mask %>
d-i netcfg/get_nameservers string <%= [@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n| n.blank?}.join(' ') %>
d-i netcfg/get_gateway string <%= @host.subnet.gateway %>
d-i netcfg/confirm_static boolean true
<% end -%>
# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string <%= @host %>
......
# 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 -%>
d-i time/zone string <%= @host.params["time-zone"] || "UTC" %>
# NTP
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string <%= @host.params["ntp-server"] || "0.debian.pool.ntp.org" %>
# Set alignment for automatic partitioning
# Choices: cylinder, minimal, optimal
......
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' -%>
<% if puppet_enabled && @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
......
# 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" -%>
<% if puppet_enabled %>
<% 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 -%>
<% else -%>
<% puppet_package = "puppet" -%>
<% puppet_package = "" -%>
<% end -%>
# Install some base packages
app/views/unattended/preseed/userdata.erb
<%#
kind: user_data
name: Community Preseed UserData
oses:
- Debian 6.0
- Debian 7.0
- Ubuntu 12.04
%>
#!/bin/bash
<%# Cloud instances frequently have incorrect hosts data %>
<%= snippet "fix_hosts" %>
<%
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.params['force-puppet']
%>
<% if puppet_enabled %>
apt-get update
apt-get install -y puppet
cat > /etc/puppet/puppet.conf << EOF
<%= snippet "puppet.conf" %>
EOF
/bin/sed -i 's/^START=no/START=yes/' /etc/default/puppet
/bin/touch /etc/puppet/namespaceauth.conf
/usr/bin/puppet agent --config /etc/puppet/puppet.conf --onetime --tags no_such_tag <%= @host.puppetmaster.blank? ? "" : "--server #{@host.puppetmaster}" %> --no-daemonize
<% end -%>
# UserData still needs wget to mark as finished
/usr/bin/wget --quiet --output-document=/dev/null --no-check-certificate <%= foreman_url('built') %>
app/views/unattended/snippets/_fix_hosts.erb
<%#
kind: snippet
name: fix_hosts
%>
echo "<%= @host.shortname %>" > /etc/hostname
hostname <%= @host.shortname %>
cat > /etc/hosts << EOF
<%# simple snippet to generate /etc/hosts when provisioning image based systems -%>
127.0.0.1 <%= @host %> <%= @host.shortname %> localhost localhost.localdomain
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF
db/seeds.rb
[
{ :name => 'AutoYaST entire SCSI disk', :os_family => 'Suse', :source => 'autoyast/disklayout_scsi.erb' },
{ :name => 'AutoYaST entire virtual disk', :os_family => 'Suse', :source => 'autoyast/disklayout_virtual.erb' },
{ :name => 'AutoYaST LVM', :os_family => 'Suse', :source => 'autoyast/disklayout_lvm.erb' },
{ :name => 'Jumpstart default', :os_family => 'Solaris', :source => 'jumpstart/disklayout.erb' },
{ :name => 'Jumpstart mirrored', :os_family => 'Solaris', :source => 'jumpstart/disklayout_mirrored.erb' },
{ :name => 'Kickstart default', :os_family => 'Redhat', :source => 'kickstart/disklayout.erb' },
......
{ :name => 'Kickstart RHEL default', :source => 'kickstart/provision_rhel.erb', :template_kind => kinds[:provision] },
{ :name => 'Kickstart default PXELinux', :source => 'kickstart/PXELinux.erb', :template_kind => kinds[:PXELinux] },
{ :name => 'Kickstart default iPXE', :source => 'kickstart/iPXE.erb', :template_kind => kinds[:iPXE] },
{ :name => 'Kickstart default user data', :source => 'kickstart/userdata.erb', :template_kind => kinds[:user_data] },
{ :name => 'Preseed default', :source => 'preseed/provision.erb', :template_kind => kinds[:provision] },
{ :name => 'Preseed default finish', :source => 'preseed/finish.erb', :template_kind => kinds[:finish] },
{ :name => 'Preseed default PXELinux', :source => 'preseed/PXELinux.erb', :template_kind => kinds[:PXELinux] },
{ :name => 'Preseed default iPXE', :source => 'preseed/iPXE.erb', :template_kind => kinds[:iPXE] },
{ :name => 'Preseed default user data', :source => 'preseed/userdata.erb', :template_kind => kinds[:user_data] },
{ :name => 'WAIK default PXELinux', :source => 'waik/PXELinux.erb', :template_kind => kinds[:PXELinux], :operatingsystems => os_windows },
{ :name => "Junos default ZTP config", :source => 'ztp/ZTP.erb', :template_kind => kinds[:ZTP], :operatingsystems => os_junos },
{ :name => "Junos default finish", :source => 'ztp/finish.erb', :template_kind => kinds[:finish], :operatingsystems => os_junos },
# snippets
{ :name => 'epel', :source => 'snippets/_epel.erb', :snippet => true },
{ :name => 'fix_hosts', :source => 'snippets/_fix_hosts.erb', :snippet => true },
{ :name => 'http_proxy', :source => 'snippets/_http_proxy.erb', :snippet => true },
{ :name => 'puppet.conf', :source => 'snippets/_puppet.conf.erb', :snippet => true },
{ :name => 'redhat_register', :source => 'snippets/_redhat_register.erb', :snippet => true }

Also available in: Unified diff