diff --git a/packer/http/opensuse-13.1/autoinst.xml b/packer/http/opensuse-13.1/autoinst.xml new file mode 100644 index 000000000..27243fe0a --- /dev/null +++ b/packer/http/opensuse-13.1/autoinst.xml @@ -0,0 +1,243 @@ + + + + + + + + + false + true + false + + + + + false + 10 + true + + + false + 10 + true + + + false + 10 + true + + + + + english-us + + + en_US + en_US + + + UTC + Etc/UTC + + + + + true + + + true + false + ext4 + 131 + true + defaults + false + /boot + device + 131 + 1 + false + 512M + + + true + false + ext4 + 131 + true + defaults + false + / + device + 131 + 2 + false + max + + + true + false + swap + 130 + true + defaults + false + swap + device + 130 + 3 + false + 512M + + + CT_DISK + all + + + + + grub2 + + + + false + true + + true + true + local + linux + + + + dhcp + enp0s3 + onboot + + + dhcp + ens33 + onboot + + + + + + false + false + + + + + + + grub2 + glibc-locale + iputils + kernel-default + kernel-default-devel + gcc + make + less + vim + sudo + screen + yast2 + yast2-firstboot + zypper + yast2-trans-en_US + wget + curl + iproute2 + ifplugd + kexec-tools + libdaemon0 + libnl1 + libxslt-tools + cryptsetup-mkinitrd + grub2-branding-openSUSE + rsyslog + + + sw_management + yast2_install_wf + base + + + virtualbox-guest-kmp-default + virtualbox-guest-tools + + + + + + + sshd + 3 5 + + + + + + + + + + + + + 100 + users + + + + + + + 100 + + /home + -1 + true + /bin/bash + /etc/skel + 022 + + + + + vagrant + root + + + vagrant + 100 + /home/vagrant + + + + -1 + 99999 + 0 + 7 + + /bin/bash + 1000 + vagrant + vagrant + + + + false + + diff --git a/packer/opensuse-13.1-i386.json b/packer/opensuse-13.1-i386.json new file mode 100644 index 000000000..48e718c0e --- /dev/null +++ b/packer/opensuse-13.1-i386.json @@ -0,0 +1,105 @@ +{ + "builders": [ + { + "boot_command": [ + "", + "linux netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse-13.1/autoinst.xml", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", + "guest_os_type": "OpenSUSE", + "http_directory": "http", + "iso_checksum": "1bd6223430910f6d5a168d4e19171462", + "iso_checksum_type": "md5", + "iso_url": "{{user `mirror`}}/13.1/iso/openSUSE-13.1-DVD-i586.iso", + "output_directory": "packer-opensuse-13.1-i386-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-opensuse-13.1-i386" + }, + { + "boot_command": [ + "", + "linux netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse-13.1/autoinst.xml", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_os_type": "opensuse", + "http_directory": "http", + "iso_checksum": "1bd6223430910f6d5a168d4e19171462", + "iso_checksum_type": "md5", + "iso_url": "{{user `mirror`}}/13.1/iso/openSUSE-13.1-DVD-i586.iso", + "output_directory": "packer-opensuse-13.1-i386-vmware", + "shutdown_command": "echo 'vagrant'|sudo -S /sbin/shutdown -h 1", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_wait_timeout": "10000s", + "tools_upload_flavor": "linux", + "type": "vmware-iso", + "vm_name": "packer-opensuse-13.1-i386", + "vmx_data": { + "cpuid.coresPerSocket": "1", + "memsize": "480", + "numvcpus": "1" + } + } + ], + "post-processors": [ + { + "output": "../builds/{{.Provider}}/opscode_opensuse-13.1-i386_chef-{{user `chef_version`}}.box", + "type": "vagrant" + } + ], + "provisioners": [ + { + "environment_vars": [ + "CHEF_VERSION={{user `chef_version`}}" + ], + "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh '{{.Path}}'", + "scripts": [ + "scripts/common/sshd.sh", + "scripts/common/vagrant.sh", + "scripts/common/vmtools.sh", + "scripts/common/chef.sh", + "scripts/opensuse/services.sh", + "scripts/opensuse/sudoers.sh", + "scripts/opensuse/zypper-locks.sh", + "scripts/opensuse/remove-dvd-source.sh", + "scripts/opensuse/cleanup.sh", + "scripts/common/minimize.sh" + ], + "type": "shell" + } + ], + "variables": { + "chef_version": "provisionerless", + "mirror": "http://download.opensuse.org/distribution" + } +} diff --git a/packer/opensuse-13.1-x86_64.json b/packer/opensuse-13.1-x86_64.json new file mode 100644 index 000000000..f2aa800b0 --- /dev/null +++ b/packer/opensuse-13.1-x86_64.json @@ -0,0 +1,106 @@ +{ + "builders": [ + { + "boot_command": [ + "", + "linux netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse-13.1/autoinst.xml", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", + "guest_os_type": "OpenSUSE_64", + "http_directory": "http", + "iso_checksum": "1096c9c67fc8a67a94a32d04a15e909d", + "iso_checksum_type": "md5", + "iso_url": "{{user `mirror`}}/13.1/iso/openSUSE-13.1-DVD-x86_64.iso", + "output_directory": "packer-opensuse-13.1-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-opensuse-13.1-x86_64" + }, + { + "boot_command": [ + "", + "linux netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse-13.1/autoinst.xml", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_os_type": "opensuse-64", + "http_directory": "http", + "iso_checksum": "1096c9c67fc8a67a94a32d04a15e909d", + "iso_checksum_type": "md5", + "iso_url": "{{user `mirror`}}/13.1/iso/openSUSE-13.1-DVD-x86_64.iso", + "output_directory": "packer-opensuse-13.1-x86_64-vmware", + "shutdown_command": "echo 'vagrant'|sudo -S /sbin/shutdown -h 1", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_wait_timeout": "10000s", + "tools_upload_flavor": "linux", + "type": "vmware-iso", + "vm_name": "packer-opensuse-13.1-x86_64", + "vmx_data": { + "cpuid.coresPerSocket": "1", + "memsize": "480", + "numvcpus": "1" + } + } + ], + "post-processors": [ + { + "output": "../builds/{{.Provider}}/opscode_opensuse-13.1-x86_64_chef-{{user `chef_version`}}.box", + "type": "vagrant" + } + ], + "provisioners": [ + { + "environment_vars": [ + "CHEF_VERSION={{user `chef_version`}}" + ], + "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh '{{.Path}}'", + "scripts": [ + "scripts/common/sshd.sh", + "scripts/common/vagrant.sh", + "scripts/common/vmtools.sh", + "scripts/common/chef.sh", + "scripts/opensuse/services.sh", + "scripts/opensuse/sudoers.sh", + "scripts/opensuse/zypper-locks.sh", + "scripts/opensuse/remove-dvd-source.sh", + "scripts/opensuse/cleanup.sh", + "scripts/common/minimize.sh" + ], + "type": "shell" + } + ], + "variables": { + "chef_version": "provisionerless", + "mirror": "http://download.opensuse.org/distribution" + } +} + diff --git a/packer/scripts/opensuse/cleanup.sh b/packer/scripts/opensuse/cleanup.sh new file mode 100644 index 000000000..2e466416d --- /dev/null +++ b/packer/scripts/opensuse/cleanup.sh @@ -0,0 +1,7 @@ +#!/bin/bash -eux +# These were only needed for building VMware/Virtualbox extensions: +zypper -n rm -u binutils gcc make site-config patterns-openSUSE-yast2_install_wf +# backlist i2c_piix4 - VirtualBox has no smbus +echo "blacklist i2c_piix4" > /etc/modprobe.d/100-blacklist-i2c_piix4.conf +# remove all kernels except current running +rpm -qa | grep kernel-default | grep -v `uname -r | awk -F"-" '{print $1"-"$2}'` | xargs rpm -ehv diff --git a/packer/scripts/opensuse/remove-dvd-source.sh b/packer/scripts/opensuse/remove-dvd-source.sh new file mode 100644 index 000000000..adbf70616 --- /dev/null +++ b/packer/scripts/opensuse/remove-dvd-source.sh @@ -0,0 +1,11 @@ +#!/bin/sh -eux + +zypper removerepo "openSUSE-13.1-1.10" +rpm --import http://download.opensuse.org/distribution/13.1/repo/oss/gpg-pubkey-3dbdc284-4be1884d.asc +rpm --import http://download.opensuse.org/distribution/13.1/repo/oss/gpg-pubkey-307e3d54-4be01a65.asc +zypper ar http://download.opensuse.org/distribution/13.1/repo/oss/ opensuse-13.1-oss +zypper ar http://download.opensuse.org/distribution/13.1/repo/non-oss/ opensuse-13.1-non-oss +zypper ar http://download.opensuse.org/update/13.1/ opensuse-13.1-update +zypper ar http://download.opensuse.org/update/13.1-non-oss/ opensuse-13.1-update-non-oss +zypper refresh +zypper update -y diff --git a/packer/scripts/opensuse/services.sh b/packer/scripts/opensuse/services.sh new file mode 100644 index 000000000..51891328b --- /dev/null +++ b/packer/scripts/opensuse/services.sh @@ -0,0 +1,5 @@ +#!/bin/sh -eux + +systemctl enable sshd +systemctl enable network +systemctl enable rsyslog \ No newline at end of file diff --git a/packer/scripts/opensuse/sudoers.sh b/packer/scripts/opensuse/sudoers.sh new file mode 100644 index 000000000..a80d47031 --- /dev/null +++ b/packer/scripts/opensuse/sudoers.sh @@ -0,0 +1,5 @@ +#!/bin/sh -eux + +# update sudoers - can't do this in autoinst.xml +echo -e "\nupdate sudoers ..." +echo -e "vagrant ALL=(ALL) NOPASSWD: ALL\n" >> /etc/sudoers diff --git a/packer/scripts/opensuse/zypper-locks.sh b/packer/scripts/opensuse/zypper-locks.sh new file mode 100644 index 000000000..a9e4e4ffb --- /dev/null +++ b/packer/scripts/opensuse/zypper-locks.sh @@ -0,0 +1,4 @@ +#!/bin/sh -eux + +# remove zypper locks on removed packages to avoid later dependency problems +zypper --non-interactive rl \*