summaryrefslogtreecommitdiffstats
path: root/http
diff options
context:
space:
mode:
authorJonathan Bauer2017-03-10 18:37:04 +0100
committerJonathan Bauer2017-03-10 18:37:04 +0100
commite866286a4411138c49e329b7e71f67d9b187edba (patch)
treedb7fefef0b82ca5577641a18935d6f3937fe02f6 /http
parentinitial commit (diff)
downloadpacker-templates-e866286a4411138c49e329b7e71f67d9b187edba.tar.gz
packer-templates-e866286a4411138c49e329b7e71f67d9b187edba.tar.xz
packer-templates-e866286a4411138c49e329b7e71f67d9b187edba.zip
Templates for Centos 7.3 and Ubuntu 16.04
These were tested with qemu (2.8.0), virtualbox (5.1.16) and vmplayer (12.5.2-4638234). Using the qemu builder is preferable as it creates a qcow2 file directly. The unattended install is configured to install the necessary packages for ansible which will be needed to provision the VM. The rest is still pretty minimal.
Diffstat (limited to 'http')
-rw-r--r--http/centos-7.3/anaconda-ks.cfg37
-rw-r--r--http/ubuntu-16.04/preseed.cfg51
2 files changed, 88 insertions, 0 deletions
diff --git a/http/centos-7.3/anaconda-ks.cfg b/http/centos-7.3/anaconda-ks.cfg
new file mode 100644
index 0000000..8cb0be2
--- /dev/null
+++ b/http/centos-7.3/anaconda-ks.cfg
@@ -0,0 +1,37 @@
+install
+text
+reboot
+url --mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
+lang en_US.UTF-8
+keyboard --vckeymap=de-nodeadkeys --xlayouts='de (nodeadkeys)'
+timezone Europe/Berlin --isUtc --nontp
+auth --enableshadow --passalgo=sha512
+rootpw --iscrypted $6$6yzbOJJy5auuBh9$XUAtAt/ErLkz6.1t8J4UpyZPPUbKjGO1uATaZaxmG02IhJbOwnJMqI6MTJw.SzbBvy8THCmmoia1tVMfXhGVJ1
+clearpart --none --initlabel
+bootloader --location=mbr --boot-drive=sda
+part biosboot --fstype="biosboot" --ondisk=sda --size=1
+part / --fstype="ext4" --ondisk=sda --grow --label=SLX_SYS
+
+%packages
+@^minimal
+@core
+kexec-tools
+%end
+
+%post --erroronfail
+yum -y update
+yum -y install wget
+wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+rpm -ivh epel-release-latest-7.noarch.rpm
+yum -y install ansible
+# allow root login for ansible
+sed 's,^[[:blank:]]*#*PermitRootLogin.*,PermitRootLogin yes,g' /etc/ssh/sshd_config
+
+ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
+cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF
+DEVICE="eth0"
+BOOTPROTO="dhcp"
+ONBOOT="yes"
+TYPE="Ethernet"
+EOF
+%end
diff --git a/http/ubuntu-16.04/preseed.cfg b/http/ubuntu-16.04/preseed.cfg
new file mode 100644
index 0000000..598790b
--- /dev/null
+++ b/http/ubuntu-16.04/preseed.cfg
@@ -0,0 +1,51 @@
+d-i debian-installer/locale string en_US
+d-i time/zone string UTC
+
+d-i keyboard-configuration/xkb-keymap select de
+
+d-i partman-basicfilesystems/choose_label string gpt
+d-i partman-basicfilesystems/default_label string gpt
+d-i partman-basicfilesystems/no_swap boolean false
+d-i partman-partitioning/choose_label string gpt
+d-i partman-partitioning/default_label string gpt
+d-i partman/choose_label string gpt
+d-i partman/default_label string gpt
+d-i partman-auto/method string regular
+d-i partman-auto/expert_recipe string \
+ scheme :: \
+ 32 32 32 free \
+ $gptonly{ } \
+ $primary{ } \
+ $bios_boot{ } \
+ method{ biosgrub } . \
+ 1 0 -1 ext4 \
+ $gptonly{ } \
+ $primary{ } \
+ method{ format } \
+ format{ } \
+ use_filesystem{ } \
+ filesystem{ ext4 } \
+ label{ SLX_SYS } \
+ mountpoint{ / } .
+d-i partman-partitioning/confirm_write_new_label boolean true
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+d-i partman/confirm_nooverwrite boolean true
+
+d-i base-installer/excludes string laptop-detect
+d-i passwd/make-user boolean false
+d-i passwd/root-login boolean true
+d-i passwd/root-password-crypted password $6$6yzbOJJy5auuBh9$XUAtAt/ErLkz6.1t8J4UpyZPPUbKjGO1uATaZaxmG02IhJbOwnJMqI6MTJw.SzbBvy8THCmmoia1tVMfXhGVJ1
+d-i user-setup/allow-password-weak boolean true
+
+d-i pkgsel/include string curl openssh-server sudo ansible
+d-i pkgsel/language-packs multiselect
+
+d-i finish-install/reboot_in_progress note
+
+d-i preseed/early_command string \
+ mkdir -p /usr/lib/post-base-installer.d && \
+ echo "sed -i -e 's/^in-target.*tasksel.*/#\\0/' /var/lib/dpkg/info/pkgsel.postinst" > /usr/lib/post-base-installer.d/90skip-tasksel && \
+ chmod +x /usr/lib/post-base-installer.d/90skip-tasksel
+
+d-i preseed/late_command string sed -i 's,^PermitRootLogin.*,PermitRootLogin yes,' /target/etc/ssh/sshd_config