initial Centos-7 support
diff --git a/centos-7.0/http/ks.cfg b/centos-7.0/http/ks.cfg
new file mode 100644
index 0000000..cd5ef97
--- /dev/null
+++ b/centos-7.0/http/ks.cfg
@@ -0,0 +1,41 @@
+install
+cdrom
+lang en_US.UTF-8
+keyboard us
+network --onboot yes --device eth0 --bootproto dhcp --noipv6
+rootpw --plaintext vagrant
+firewall --enabled --service=ssh
+authconfig --enableshadow --passalgo=sha512
+selinux --disabled
+timezone Europe/Prague
+bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
+
+text
+skipx
+zerombr
+
+clearpart --all --initlabel
+autopart
+
+auth --useshadow --enablemd5
+firstboot --disabled
+reboot
+
+%packages --ignoremissing
+@core
+bzip2
+kernel-devel
+kernel-headers
+-ipw2100-firmware
+-ipw2200-firmware
+-ivtv-firmware
+%end
+
+%post
+/usr/bin/yum -y install sudo
+/usr/sbin/groupadd -g 501 vagrant
+/usr/sbin/useradd vagrant -u 501 -g vagrant -G wheel
+echo "vagrant"|passwd --stdin vagrant
+echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
+chmod 0440 /etc/sudoers.d/vagrant
+%end
diff --git a/centos-7.0/scripts/base.sh b/centos-7.0/scripts/base.sh
new file mode 100644
index 0000000..f3e482c
--- /dev/null
+++ b/centos-7.0/scripts/base.sh
@@ -0,0 +1,3 @@
+sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
+yum -y install gcc make gcc-c++ kernel-devel-`uname -r` perl
+
diff --git a/centos-7.0/scripts/cleanup.sh b/centos-7.0/scripts/cleanup.sh
new file mode 100644
index 0000000..c7ee1a1
--- /dev/null
+++ b/centos-7.0/scripts/cleanup.sh
@@ -0,0 +1,5 @@
+yum -y erase gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
+yum -y clean all
+rm -rf VBoxGuestAdditions_*.iso
+rm -rf /tmp/rubygems-*
+
diff --git a/centos-7.0/scripts/salt.sh b/centos-7.0/scripts/salt.sh
new file mode 100644
index 0000000..5d7eb8d
--- /dev/null
+++ b/centos-7.0/scripts/salt.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+curl -L https://bootstrap.saltstack.com | sudo sh -s --
+curl -k -L https://bootstrap.saltstack.com | sudo sh -s --
+
diff --git a/centos-7.0/scripts/vagrant.sh b/centos-7.0/scripts/vagrant.sh
new file mode 100644
index 0000000..c3e2631
--- /dev/null
+++ b/centos-7.0/scripts/vagrant.sh
@@ -0,0 +1,6 @@
+date > /etc/vagrant_box_build_time
+
+mkdir -pm 700 /home/vagrant/.ssh
+curl -L https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub -o /home/vagrant/.ssh/authorized_keys
+chmod 0600 /home/vagrant/.ssh/authorized_keys
+chown -R vagrant:vagrant /home/vagrant/.ssh
diff --git a/centos-7.0/scripts/virtualbox.sh b/centos-7.0/scripts/virtualbox.sh
new file mode 100644
index 0000000..ba53d21
--- /dev/null
+++ b/centos-7.0/scripts/virtualbox.sh
@@ -0,0 +1,7 @@
+VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
+cd /tmp
+mount -o loop /home/vagrant/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
+sh /mnt/VBoxLinuxAdditions.run
+umount /mnt
+rm -rf /home/vagrant/VBoxGuestAdditions_*.iso
+
diff --git a/centos-7.0/scripts/zerodisk.sh b/centos-7.0/scripts/zerodisk.sh
new file mode 100644
index 0000000..45f45ed
--- /dev/null
+++ b/centos-7.0/scripts/zerodisk.sh
@@ -0,0 +1,3 @@
+dd if=/dev/zero of=/EMPTY bs=1M
+rm -f /EMPTY
+
diff --git a/centos-7.0/template.json b/centos-7.0/template.json
new file mode 100644
index 0000000..f6f2db4
--- /dev/null
+++ b/centos-7.0/template.json
@@ -0,0 +1,124 @@
+{
+ "variables": {
+ "user": "{{ env `BUILD_USER` }}",
+ "password": "{{ env `BUILD_PASSWORD` }}",
+ "do_api_token": "{{ env `DO_API_TOKEN` }}",
+ "distro": "Centos-7",
+ "disk_size": 8000
+ },
+ "provisioners": [
+ {
+ "type": "shell",
+ "execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
+ "override": {
+ "virtualbox-iso": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/vagrant.sh",
+ "scripts/virtualbox.sh",
+ "scripts/cleanup.sh"
+ ]
+ },
+ "vmware-iso": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/vagrant.sh",
+ "scripts/vmware.sh",
+ "scripts/cleanup.sh"
+ ]
+ },
+ "qemu": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/cleanup.sh",
+ "scripts/zerodisk.sh"
+ ]
+ }
+ }
+ }
+ ],
+ "post-processors": [
+ {
+ "type": "vagrant",
+ "override": {
+ "virtualbox": {
+ "output": "centos-7-0-x64-virtualbox.box"
+ },
+ "vmware": {
+ "output": "centos-7-0-x64-vmware.box"
+ }
+ }
+ }
+ ],
+ "builders": [
+ {
+ "type": "virtualbox-iso",
+ "boot_command": [
+ "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter><wait>"
+ ],
+ "boot_wait": "10s",
+ "disk_size": 5020,
+ "guest_os_type": "RedHat_64",
+ "http_directory": "http",
+ "iso_checksum": "99e450fb1b22d2e528757653fcbf5fdc",
+ "iso_checksum_type": "sha1",
+ "iso_url": "http://ftp.fi.muni.cz/pub/linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1503.iso",
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "ssh_port": 22,
+ "ssh_wait_timeout": "10000s",
+ "shutdown_command": "echo '/sbin/halt -h -p' > /tmp/shutdown.sh; echo 'vagrant'|sudo -S sh '/tmp/shutdown.sh'",
+ "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
+ "virtualbox_version_file": ".vbox_version",
+ "vboxmanage": [
+ [ "modifyvm", "{{.Name}}", "--memory", "512" ],
+ [ "modifyvm", "{{.Name}}", "--cpus", "1" ]
+ ]
+ },
+ {
+ "type": "qemu",
+ "vm_name": "{{ user `distro` }}-{{ timestamp }}",
+ "output_directory": "images/{{ user `distro` }}-{{ timestamp }}",
+ "format": "qcow2",
+ "accelerator": "kvm",
+ "disk_size": "{{ user `disk_size`}}",
+ "iso_checksum": "99e450fb1b22d2e528757653fcbf5fdc",
+ "iso_checksum_type": "sha1",
+ "iso_url": "http://ftp.fi.muni.cz/pub/linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1503.iso",
+ "http_directory": "http",
+ "headless": true,
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
+ "boot_wait": "2s",
+ "boot_command": [
+ "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter><wait>"
+ ]
+ },
+ {
+ "type": "vmware-iso",
+ "boot_command": [
+ "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter><wait>"
+ ],
+ "boot_wait": "10s",
+ "disk_size": 40520,
+ "guest_os_type": "centos-64",
+ "http_directory": "http",
+ "iso_checksum": "154ba47b7a37e52e0100310c3aeb8f9d9daf4806",
+ "iso_checksum_type": "sha1",
+ "iso_url": "http://ftp.iij.ad.jp/pub/linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-DVD.iso",
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "ssh_port": 22,
+ "ssh_wait_timeout": "10000s",
+ "shutdown_command": "echo '/sbin/halt -h -p' > /tmp/shutdown.sh; echo 'vagrant'|sudo -S sh '/tmp/shutdown.sh'",
+ "tools_upload_flavor": "linux",
+ "vmx_data": {
+ "memsize": "512",
+ "numvcpus": "1",
+ "cpuid.coresPerSocket": "1"
+ }
+ }
+ ]
+}
diff --git a/config.sh b/config.sh
index f9614c9..5f5428d 100644
--- a/config.sh
+++ b/config.sh
@@ -7,6 +7,6 @@
read -r BUILD_USER_INPUT
export BUILD_USER=$BUILD_USER_INPUT
echo "Please enter provision password: "
-read -sr BUILD_PASSWORD_INPUT
+read -r BUILD_PASSWORD_INPUT
export BUILD_PASSWORD=$BUILD_PASSWORD_INPUT
diff --git a/ubuntu-14.04/scripts/salt.sh b/ubuntu-14.04/scripts/salt.sh
index e8e75b5..5d7eb8d 100644
--- a/ubuntu-14.04/scripts/salt.sh
+++ b/ubuntu-14.04/scripts/salt.sh
@@ -1,3 +1,4 @@
#!/bin/sh
+curl -L https://bootstrap.saltstack.com | sudo sh -s --
curl -k -L https://bootstrap.saltstack.com | sudo sh -s --