Skip to content

Commit

Permalink
Support Red Hat Enterprise Linux 7 Release Candidate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian C. Dunn committed Apr 24, 2014
1 parent 3059861 commit 84fb194
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 2 deletions.
73 changes: 73 additions & 0 deletions packer/http/centos-7.0/ks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
install
cdrom
lang en_US.UTF-8
keyboard us
network --bootproto=dhcp
rootpw vagrant
firewall --disabled
selinux --permissive
timezone UTC
unsupported_hardware
bootloader --location=mbr
text
skipx
zerombr
clearpart --all --initlabel
autopart
auth --enableshadow --passalgo=sha512 --kickstart
firstboot --disabled
reboot
user --name=vagrant --plaintext --password vagrant

%packages --nobase --ignoremissing --excludedocs
# vagrant needs this to copy initial files via scp
openssh-clients
sudo
kernel-headers
kernel-devel
gcc
make
perl
curl
wget
nfs-utils
bzip2
-fprintd-pam
-intltool

# unnecessary firmware
-aic94xx-firmware
-atmel-firmware
-b43-openfwwf
-bfa-firmware
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
-iwl100-firmware
-iwl1000-firmware
-iwl3945-firmware
-iwl4965-firmware
-iwl5000-firmware
-iwl5150-firmware
-iwl6000-firmware
-iwl6000g2a-firmware
-iwl6050-firmware
-libertas-usb8388-firmware
-ql2100-firmware
-ql2200-firmware
-ql23xx-firmware
-ql2400-firmware
-ql2500-firmware
-rt61pci-firmware
-rt73usb-firmware
-xorg-x11-drv-ati-firmware
-zd1211-firmware
%end

%post
# update root certs
wget -O/etc/pki/tls/certs/ca-bundle.crt http://curl.haxx.se/ca/cacert.pem
# sudo
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
%end
95 changes: 95 additions & 0 deletions packer/rhel-7.0-x86_64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"builders": [
{
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos-7.0/ks.cfg<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 40960,
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "RedHat_64",
"http_directory": "http",
"iso_checksum": "bea5e951342a7ab0233219c3deb3b3acff023ea5dc67a9a4564a97a89364f192",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/rc/7/Server/x86_64/iso/rhel-server-7.0-x86_64-dvd.iso",
"output_directory": "packer-rhel-7.0-x86_64-virtualbox",
"shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_wait_timeout": "10000s",
"type": "virtualbox-iso",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"480"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"1"
]
],
"virtualbox_version_file": ".vbox_version",
"vm_name": "packer-centos-7.0-x86_64"
},
{
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel-7.0/ks.cfg<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 40960,
"guest_os_type": "redhat-64",
"http_directory": "http",
"iso_checksum": "bea5e951342a7ab0233219c3deb3b3acff023ea5dc67a9a4564a97a89364f192",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/rc/7/Server/x86_64/iso/rhel-server-7.0-x86_64-dvd.iso",
"output_directory": "packer-rhel-7.0-x86_64-vmware",
"shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_wait_timeout": "10000s",
"tools_upload_flavor": "linux",
"type": "vmware-iso",
"vm_name": "packer-centos-7.0-x86_64",
"vmx_data": {
"cpuid.coresPerSocket": "1",
"memsize": "480",
"numvcpus": "1"
}
}
],
"post-processors": [
{
"output": "../builds/{{.Provider}}/opscode_rhel-7.0_chef-{{user `chef_version`}}.box",
"type": "vagrant"
}
],
"provisioners": [
{
"environment_vars": [
"CHEF_VERSION={{user `chef_version`}}"
],
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"scripts": [
"scripts/centos/fix-slow-dns.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/chef.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
"type": "shell"
}
],
"variables": {
"chef_version": "provisionerless",
"mirror": "http://ftp.redhat.com/redhat/rhel"
}
}

6 changes: 4 additions & 2 deletions packer/scripts/centos/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ rm -f /tmp/chef*rpm

# clean up redhat interface persistence
rm -f /etc/udev/rules.d/70-persistent-net.rules
sed -i 's/^HWADDR.*$//' /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i 's/^UUID.*$//' /etc/sysconfig/network-scripts/ifcfg-eth0
if [ -r /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
sed -i 's/^HWADDR.*$//' /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i 's/^UUID.*$//' /etc/sysconfig/network-scripts/ifcfg-eth0
fi

0 comments on commit 84fb194

Please sign in to comment.