From dd6494b9e8a873cd392fbac6bb691e74b9c55b2d Mon Sep 17 00:00:00 2001 From: Rob Dobson Date: Mon, 10 Nov 2014 18:32:25 +0000 Subject: [PATCH] Adding example packer config file and kick-starter file. (Note: currently the xs-tools RPMs are a dependency). Signed-off-by: Rob Dobson --- examples/centos-6.4.conf | 26 ++++++++++++++++++ examples/http/centos6-ks.cfg | 53 ++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 examples/centos-6.4.conf create mode 100644 examples/http/centos6-ks.cfg diff --git a/examples/centos-6.4.conf b/examples/centos-6.4.conf new file mode 100644 index 0000000..3abed34 --- /dev/null +++ b/examples/centos-6.4.conf @@ -0,0 +1,26 @@ +{ + "builders": [{ + "type": "xenserver", + "username": "root", + "password": "hostpassword", + "host_ip": "10.81.2.105", + "instance_name": "packer-centos-6-4", + "root_disk_size": "5000000000", + "clone_template": "b31a4a3a-a44f-68df-bb53-33529a9db3b7", + "iso_uuid": "3079a3f4-a49b-4f65-8afd-c2351b2c3399", + "sr_uuid": "88328079-d58d-2b43-1f28-982e0e60ec23", + "network_uuid": "02021c25-34b8-2a32-3f55-1d6338e869e2", + "iso_url": "http://mirrors.usc.edu/pub/linux/distributions/centos/6.4/isos/x86_64/CentOS-6.4-x86_64-minimal.iso", + "iso_checksum_type": "md5", + "iso_checksum": "4a5fa01c81cc300f4729136e28ebe600", + "http_directory": "http", + "local_ip": "10.80.3.223", + "ssh_username": "root", + "ssh_password": "vmpassword", + "boot_command": + [ + "", + " ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos6-ks.cfg" + ] + }] +} diff --git a/examples/http/centos6-ks.cfg b/examples/http/centos6-ks.cfg new file mode 100644 index 0000000..4259930 --- /dev/null +++ b/examples/http/centos6-ks.cfg @@ -0,0 +1,53 @@ +install +cdrom +lang en_US.UTF-8 +keyboard us +unsupported_hardware +network --bootproto=dhcp +rootpw --iscrypted $1$wwD0QIub$WNz1RShXh1UapQzmpF4/c1 +firewall --disabled +authconfig --enableshadow --passalgo=sha512 +selinux --permissive +timezone UTC +bootloader --location=mbr +text +skipx +zerombr +clearpart --all --initlabel +autopart +auth --useshadow --enablemd5 +firstboot --disabled +#reboot +poweroff + +%packages --ignoremissing +@Base +@Core +@Development Tools +openssl-devel +readline-devel +zlib-devel +kernel-devel +vim +wget +%end + +%post +yum -y update + +# update root certs +wget -O/etc/pki/tls/certs/ca-bundle.crt http://curl.haxx.se/ca/cacert.pem + +# xe-guest-utilities +rpm -Uhv http://cam-st05.uk.xensource.com/xe-guest-utilities-xenstore-6.4.93-1292.x86_64.rpm +rpm -Uvh http://cam-st05.uk.xensource.com/xe-guest-utilities-6.4.93-1292.x86_64.rpm + +# vagrant +groupadd vagrant -g 999 +useradd vagrant -g vagrant -G wheel -u 900 -s /bin/bash +echo "vagrant" | passwd --stdin vagrant + +# sudo +echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers +%end