Skip to content

Commit

Permalink
Update Fedora templates
Browse files Browse the repository at this point in the history
- Fixes #218
  • Loading branch information
sethvargo committed May 1, 2014
1 parent eaae31f commit 57b8bc5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 59 deletions.
58 changes: 20 additions & 38 deletions packer/fedora-19.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,49 @@
"builders": [
{
"boot_command": [
"<tab> linux ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora-19/ks.cfg<enter><wait>"
"<tab> linux ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora/ks.cfg<enter><wait>"
],
"boot_wait": "10s",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_additions_path": "VBoxGuestAdditions_{{ .Version }}.iso",
"guest_os_type": "Fedora_64",
"http_directory": "http",
"iso_checksum": "6e7e263e607cfcadc90ea2ef5668aa3945d9eca596485a7a1f8a9f2478cc7084",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/19/Fedora/x86_64/iso/Fedora-19-x86_64-DVD.iso",
"output_directory": "packer-fedora-19-x86_64-virtualbox",
"iso_url": "http://mirrors.kernel.org/fedora/releases/19/Fedora/x86_64/iso/Fedora-19-x86_64-DVD.iso",
"output_directory": "chef-fedora-19-virtualbox",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_wait_timeout": "10000s",
"type": "virtualbox-iso",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"512"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"1"
]
["modifyvm", "{{ .Name }}", "--memory", "512"],
["modifyvm", "{{ .Name }}", "--cpus", "1"]
],
"virtualbox_version_file": ".vbox_version",
"vm_name": "packer-fedora-19-x86_64"
"vm_name": "chef-fedora-19-{{ timestamp }}"
},
{
"boot_command": [
"<tab> linux ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora-19/ks.cfg<enter><wait>"
"<tab> linux ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora/ks.cfg<enter><wait>"
],
"boot_wait": "10s",
"guest_os_type": "fedora-64",
"headless": true,
"http_directory": "http",
"iso_checksum": "6e7e263e607cfcadc90ea2ef5668aa3945d9eca596485a7a1f8a9f2478cc7084",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/19/Fedora/x86_64/iso/Fedora-19-x86_64-DVD.iso",
"output_directory": "packer-fedora-19-x86_64-vmware",
"iso_url": "http://mirrors.kernel.org/fedora/releases/19/Fedora/x86_64/iso/Fedora-19-x86_64-DVD.iso",
"output_directory": "chef-fedora-19-vmware",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_wait_timeout": "10000s",
"tools_upload_flavor": "linux",
"type": "vmware-iso",
"vm_name": "packer-fedora-19-x86_64",
"vm_name": "chef-fedora-19-{{ timestamp }}",
"vmx_data": {
"cpuid.coresPerSocket": "1",
"memsize": "512",
Expand All @@ -63,31 +54,22 @@
],
"post-processors": [
{
"output": "../builds/{{.Provider}}/opscode_fedora-19_chef-{{user `chef_version`}}.box",
"type": "vagrant"
"output": "../builds/fedora-19/{{ .Provider }}/{{ timestamp }}.box",
"type": "vagrant",
"compression_level": 9
}
],
"provisioners": [
{
"environment_vars": [
"CHEF_VERSION={{user `chef_version`}}"
],
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
"type": "shell",
"execute_command": "echo 'vagrant' | {{ .Vars }} sudo -S -E bash '{{ .Path }}'",
"scripts": [
"scripts/fedora/fix-slow-dns.sh",
"scripts/common/sshd.sh",
"scripts/common/vmtools.sh",
"scripts/common/chef.sh",
"scripts/common/vagrant.sh",
"scripts/fedora/cleanup.sh",
"scripts/common/minimize.sh"
],
"type": "shell"
"scripts/rhel/cleanup.sh"
]
}
],
"variables": {
"chef_version": "provisionerless",
"mirror": "http://mirrors.kernel.org/fedora"
}
]
}

19 changes: 8 additions & 11 deletions packer/scripts/fedora/ks.cfg → packer/http/fedora/ks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cdrom
lang en_US.UTF-8
keyboard us
network --bootproto=dhcp
rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
rootpw vagrant
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --permissive
Expand All @@ -22,28 +22,25 @@ bootloader --location=mbr --append="norhgb biosdevname=0"
auth --useshadow --enablemd5
firstboot --disabled
reboot
user --name=vagrant --plaintext --password vagrant

%packages
@Core
%packages --nobase --ignoremissing --excludedocs
bzip2
gcc
kernel-devel
kernel-headers
openssl-devel
readline-devel
tar
wget
zlib-devel
net-tools
nfs-utils
-linux-firmware
-plymouth
-plymouth-core-libs
%end

%post
# update root certs
wget -O /etc/pki/tls/certs/ca-bundle.crt http://curl.haxx.se/ca/cacert.pem
# vagrant
groupadd vagrant
useradd vagrant -g vagrant -G wheel -u 900
echo "vagrant" | passwd --stdin vagrant
wget -O/etc/pki/tls/certs/ca-bundle.crt http://curl.haxx.se/ca/cacert.pem
# sudo
echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant
echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant
Expand Down
5 changes: 0 additions & 5 deletions packer/scripts/fedora/cleanup.sh

This file was deleted.

1 change: 0 additions & 1 deletion packer/scripts/fedora/shutdown.sh

This file was deleted.

4 changes: 0 additions & 4 deletions packer/scripts/fedora/sudoers.sh

This file was deleted.

0 comments on commit 57b8bc5

Please sign in to comment.