From 6ab322b59f9481a893111a98c3aad21df9377965 Mon Sep 17 00:00:00 2001 From: Seth Thomas Date: Fri, 9 Oct 2015 17:33:07 -0700 Subject: [PATCH] First pass at fixing up and DRYing sles --- http/sles-11/sles-11-sp4-i386-autoinst.xml | 180 +++++++++++++++++ http/sles-11/sles-11-sp4-x86_64-autoinst.xml | 180 +++++++++++++++++ scripts/sles/remove-dvd-source.sh | 8 +- scripts/sles/zypper-locks.sh | 8 +- sles-11-sp4-i386.json | 191 +++++++++++++++++++ sles-11-sp4-x86_64.json | 191 +++++++++++++++++++ sles-12-x86_64.json | 66 ++++--- 7 files changed, 791 insertions(+), 33 deletions(-) create mode 100644 http/sles-11/sles-11-sp4-i386-autoinst.xml create mode 100644 http/sles-11/sles-11-sp4-x86_64-autoinst.xml create mode 100644 sles-11-sp4-i386.json create mode 100644 sles-11-sp4-x86_64.json diff --git a/http/sles-11/sles-11-sp4-i386-autoinst.xml b/http/sles-11/sles-11-sp4-i386-autoinst.xml new file mode 100644 index 000000000..7a2b03d84 --- /dev/null +++ b/http/sles-11/sles-11-sp4-i386-autoinst.xml @@ -0,0 +1,180 @@ + + + + + + + false + + + none + + + + true + true + true + true + false + true + + + + + + + + AUTO + + + false + vagrantup.com + vagrant-sles-11sp4-x86 + auto + + vagrantup.com + + true + + + + dhcp + eth0 + auto + no + + + true + false + + false + + + + + true + + + true + false + swap + true + defaults + false + swap + device + 130 + 1 + + false + 1561492992 + + + true + false + ext3 + true + acl,user_xattr + false + / + device + 131 + 2 + + false + 19895844352 + + + + CT_DISK + all + + + + + true + true + 0 + + + true + true + 0 + + + true + true + 0 + + + true + true + 0 + + + + + + openssh + kernel-default-devel + sudo + gcc + wget + make + + + Minimal + apparmor + + + + + + + 100 + video,dialout + /home + -1 + /bin/bash + /etc/skel + 022 + + + + true + vagrant + 100 + /home/vagrant + + + + + 99999 + 0 + 7 + + /bin/bash + 1000 + $2y$05$NA1Li9ZKJOLRW5mMTXm6/e5r8dltWS5RpDZpvHrI82aLE00V51tdi + vagrant + + + true + root + 0 + /root + + + + + + + + + /bin/bash + 0 + $2y$05$NA1Li9ZKJOLRW5mMTXm6/e5r8dltWS5RpDZpvHrI82aLE00V51tdi + root + + + diff --git a/http/sles-11/sles-11-sp4-x86_64-autoinst.xml b/http/sles-11/sles-11-sp4-x86_64-autoinst.xml new file mode 100644 index 000000000..ae21e9f85 --- /dev/null +++ b/http/sles-11/sles-11-sp4-x86_64-autoinst.xml @@ -0,0 +1,180 @@ + + + + + + + false + + + none + + + + true + true + true + true + false + true + + + + + + + + AUTO + + + false + vagrantup.com + vagrant-sles-11sp4-x64 + auto + + vagrantup.com + + true + + + + dhcp + eth0 + auto + no + + + true + false + + false + + + + + true + + + true + false + swap + true + defaults + false + swap + device + 130 + 1 + + false + 1561492992 + + + true + false + ext3 + true + acl,user_xattr + false + / + device + 131 + 2 + + false + 19895844352 + + + + CT_DISK + all + + + + + true + true + 0 + + + true + true + 0 + + + true + true + 0 + + + true + true + 0 + + + + + + openssh + kernel-default-devel + sudo + gcc + wget + make + + + Minimal + apparmor + + + + + + + 100 + video,dialout + /home + -1 + /bin/bash + /etc/skel + 022 + + + + true + vagrant + 100 + /home/vagrant + + + + + 99999 + 0 + 7 + + /bin/bash + 1000 + $2y$05$NA1Li9ZKJOLRW5mMTXm6/e5r8dltWS5RpDZpvHrI82aLE00V51tdi + vagrant + + + true + root + 0 + /root + + + + + + + + + /bin/bash + 0 + $2y$05$NA1Li9ZKJOLRW5mMTXm6/e5r8dltWS5RpDZpvHrI82aLE00V51tdi + root + + + diff --git a/scripts/sles/remove-dvd-source.sh b/scripts/sles/remove-dvd-source.sh index 632fa6cbc..7eef549e7 100644 --- a/scripts/sles/remove-dvd-source.sh +++ b/scripts/sles/remove-dvd-source.sh @@ -14,16 +14,16 @@ if [ $oslevel == '11' ]; then repo_ver="11.2.2-1.234" elif [ $patchlevel == '3' ]; then repo_ver="11.3.3-1.138" + elif [ $patchlevel == '4' ]; then + repo_ver="11.4.4-1.109" else echo "Failed to remove DVD source; don't know how to deal with patchlevel $patchlevel" exit 1 fi zypper removerepo "SUSE-Linux-Enterprise-Server-11-SP$patchlevel $repo_ver" - zypper addrepo "http://demeter.uni-regensburg.de/SLES11SP$patchlevel-$arch_suffix/DVD1/" "SLES11SP$patchlevel-$arch_suffix DVD1 Online" + elif [ $oslevel == '12' ]; then - zypper removerepo "SLES12-12-$patchlevel" - zypper addrepo "http://demeter.uni-regensburg.de/SLES12-$arch_suffix/DVD1/" "SLES12-12-$patchlevel-$arch_suffix DVD1 Online" - zypper addrepo "http://demeter.uni-regensburg.de/SLES12-$arch_suffix/DVD2/" "SLES12-12-$patchlevel-$arch_suffix DVD2 Online" + zypper removerepo "SLES12-12-$patchlevel"; fi zypper refresh diff --git a/scripts/sles/zypper-locks.sh b/scripts/sles/zypper-locks.sh index a86fa5f4a..fe464451b 100644 --- a/scripts/sles/zypper-locks.sh +++ b/scripts/sles/zypper-locks.sh @@ -1,4 +1,10 @@ #!/bin/sh -eux # remove zypper locks on removed packages to avoid later dependency problems -zypper --non-interactive ll | grep package | awk -F\| '{ print $2 }' | xargs -n 20 zypper --non-interactive rl +any_package_locks=`zypper --non-interactive ll | grep package`; + +if [ 'There are no package locks defined.' == "$any_package_locks" ]; then + echo 'There are no package locks defined. Doing nothing.'; +else + zypper --non-interactive ll | grep package | awk -F\| '{ print $2 }' | xargs -n 20 zypper --non-interactive rl; +fi diff --git a/sles-11-sp4-i386.json b/sles-11-sp4-i386.json new file mode 100644 index 000000000..d57dc7aa7 --- /dev/null +++ b/sles-11-sp4-i386.json @@ -0,0 +1,191 @@ +{ + "builders": [ + { + "boot_command": [ + "", + "linux netdevice=eth0 netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", + "guest_os_type": "OpenSUSE", + "hard_drive_interface": "sata", + "headless": "{{ user `headless` }}", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-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": "{{ user `template` }}" + }, + { + "boot_command": [ + "", + "linux netdevice=eth0 netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_os_type": "sles11", + "headless": "{{ user `headless` }}", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-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": "{{ user `template` }}", + "vmx_data": { + "cpuid.coresPerSocket": "1", + "memsize": "480", + "numvcpus": "1" + } + }, + { + "boot_command": [ + "", + "linux netdevice=eth0 netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_os_type": "suse", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-parallels", + "parallels_tools_flavor": "lin", + "prlctl": [ + [ + "set", + "{{.Name}}", + "--memsize", + "480" + ], + [ + "set", + "{{.Name}}", + "--cpus", + "1" + ] + ], + "prlctl_version_file": ".prlctl_version", + "shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_wait_timeout": "10000s", + "type": "parallels-iso", + "vm_name": "{{ user `template` }}" + }, + { + "boot_command": [ + "", + "linux netdevice=eth0 netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-qemu", + "shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_wait_timeout": "10000s", + "type": "qemu", + "vm_name": "{{ user `template` }}" + } + ], + "post-processors": [ + { + "output": "builds/{{user `box_basename`}}.{{.Provider}}.box", + "type": "vagrant" + } + ], + "provisioners": [ + { + "destination": "/tmp/bento-metadata.json", + "source": "{{user `metadata`}}", + "type": "file" + }, + { + "environment_vars": [ + "HOME_DIR=/home/vagrant", + "http_proxy={{user `http_proxy`}}", + "https_proxy={{user `https_proxy`}}", + "no_proxy={{user `no_proxy`}}" + ], + "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh '{{.Path}}'", + "scripts": [ + "scripts/common/metadata.sh", + "scripts/common/sshd.sh", + "scripts/common/vagrant.sh", + "scripts/common/vmtools.sh", + "scripts/sles/sudoers.sh", + "scripts/sles/zypper-locks.sh", + "scripts/sles/remove-dvd-source.sh", + "scripts/common/minimize.sh" + ], + "type": "shell" + } + ], + "variables": { + "arch": "32", + "autoinst_cfg": "sles-11/sles-11-sp4-i386-autoinst.xml", + "box_basename": "sles-11-sp4-i386", + "build_timestamp": "{{isotime \"20060102150405\"}}", + "git_revision": "__unknown_git_revision__", + "headless": "", + "http_proxy": "{{env `http_proxy`}}", + "https_proxy": "{{env `https_proxy`}}", + "iso_checksum": "3e2f09b0a5dc04f4b8cafa174ab971b7355b8f6c22925aab1d1817fff5c7e549", + "iso_checksum_type": "sha256", + "iso_name": "SLES-11-SP4-DVD-i586-GM-DVD1.iso", + "metadata": "floppy/dummy_metadata.json", + "mirror": "http://cdn.novell.com/prot/46PZWZ91TPo~", + "name": "sles-11-sp4-i386", + "template": "sles-11-sp4-i386", + "version": "2.0.TIMESTAMP" + } +} diff --git a/sles-11-sp4-x86_64.json b/sles-11-sp4-x86_64.json new file mode 100644 index 000000000..99afcb614 --- /dev/null +++ b/sles-11-sp4-x86_64.json @@ -0,0 +1,191 @@ +{ + "builders": [ + { + "boot_command": [ + "", + "linux netdevice=eth0 netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", + "guest_os_type": "OpenSUSE_64", + "hard_drive_interface": "sata", + "headless": "{{ user `headless` }}", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-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": "{{ user `template` }}" + }, + { + "boot_command": [ + "", + "linux netdevice=eth0 netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_os_type": "sles11-64", + "headless": "{{ user `headless` }}", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-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": "{{ user `template` }}", + "vmx_data": { + "cpuid.coresPerSocket": "1", + "memsize": "480", + "numvcpus": "1" + } + }, + { + "boot_command": [ + "", + "linux netdevice=eth0 netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "guest_os_type": "suse", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-parallels", + "parallels_tools_flavor": "lin", + "prlctl": [ + [ + "set", + "{{.Name}}", + "--memsize", + "480" + ], + [ + "set", + "{{.Name}}", + "--cpus", + "1" + ] + ], + "prlctl_version_file": ".prlctl_version", + "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_wait_timeout": "10000s", + "type": "parallels-iso", + "vm_name": "{{ user `template` }}" + }, + { + "boot_command": [ + "", + "linux netdevice=eth0 netsetup=dhcp install=cd:/", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", + " textmode=1", + "" + ], + "boot_wait": "10s", + "disk_size": 20480, + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-qemu", + "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_wait_timeout": "10000s", + "type": "qemu", + "vm_name": "{{ user `template` }}" + } + ], + "post-processors": [ + { + "output": "builds/{{user `box_basename`}}.{{.Provider}}.box", + "type": "vagrant" + } + ], + "provisioners": [ + { + "destination": "/tmp/bento-metadata.json", + "source": "{{user `metadata`}}", + "type": "file" + }, + { + "environment_vars": [ + "HOME_DIR=/home/vagrant", + "http_proxy={{user `http_proxy`}}", + "https_proxy={{user `https_proxy`}}", + "no_proxy={{user `no_proxy`}}" + ], + "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh '{{.Path}}'", + "scripts": [ + "scripts/common/metadata.sh", + "scripts/common/sshd.sh", + "scripts/common/vagrant.sh", + "scripts/common/vmtools.sh", + "scripts/sles/sudoers.sh", + "scripts/sles/zypper-locks.sh", + "scripts/sles/remove-dvd-source.sh", + "scripts/common/minimize.sh" + ], + "type": "shell" + } + ], + "variables": { + "arch": "64", + "autoinst_cfg": "sles-11/sles-11-sp4-x86_64-autoinst.xml", + "box_basename": "sles-11-sp4", + "build_timestamp": "{{isotime \"20060102150405\"}}", + "git_revision": "__unknown_git_revision__", + "headless": "", + "http_proxy": "{{env `http_proxy`}}", + "https_proxy": "{{env `https_proxy`}}", + "iso_checksum": "4fbf22201876d571c719328f385d87d6d690fb3ceb5e093108cdf0373c43e855", + "iso_checksum_type": "sha256", + "iso_name": "SLES-11-SP4-DVD-x86_64-GM-DVD1.iso", + "metadata": "floppy/dummy_metadata.json", + "mirror": "http://cdn.novell.com/prot/l7C51hFz57E~", + "name": "sles-11-sp4", + "template": "sles-11-sp4-x86_64", + "version": "2.2.TIMESTAMP" + } +} diff --git a/sles-12-x86_64.json b/sles-12-x86_64.json index 688e76130..5f2b60d7f 100644 --- a/sles-12-x86_64.json +++ b/sles-12-x86_64.json @@ -4,7 +4,7 @@ "boot_command": [ "", "linux netdevice=eth0 netsetup=dhcp install=cd:/", - " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/sles-12/sles-12-x86_64-autoinst.xml", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", " textmode=1", "" ], @@ -15,11 +15,11 @@ "hard_drive_interface": "sata", "headless": "{{ user `headless` }}", "http_directory": "http", - "iso_checksum": "58086fca0441b1d44c7a51c5ee64e1bd4365466fcee48ec92c4f39d07739aeed", - "iso_checksum_type": "sha256", - "iso_url": "{{user `mirror`}}/SLE-12-Server-DVD-x86_64-GM-DVD1.iso", - "output_directory": "packer-sles-12-x86_64-virtualbox", - "shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-virtualbox", + "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", "ssh_password": "vagrant", "ssh_port": 22, "ssh_username": "vagrant", @@ -46,7 +46,7 @@ "boot_command": [ "", "linux netdevice=eth0 netsetup=dhcp install=cd:/", - " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/sles-12/sles-12-x86_64-autoinst.xml", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", " textmode=1", "" ], @@ -55,11 +55,11 @@ "guest_os_type": "sles11-64", "headless": "{{ user `headless` }}", "http_directory": "http", - "iso_checksum": "58086fca0441b1d44c7a51c5ee64e1bd4365466fcee48ec92c4f39d07739aeed", - "iso_checksum_type": "sha256", - "iso_url": "{{user `mirror`}}/SLE-12-Server-DVD-x86_64-GM-DVD1.iso", - "output_directory": "packer-sles-12-sp3-x86_64-vmware", - "shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-vmware", + "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", "ssh_password": "vagrant", "ssh_port": 22, "ssh_username": "vagrant", @@ -77,7 +77,7 @@ "boot_command": [ "", "linux netdevice=eth0 netsetup=dhcp install=cd:/", - " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/sles-12/sles-12-x86_64-autoinst.xml", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", " textmode=1", "" ], @@ -85,10 +85,10 @@ "disk_size": 20480, "guest_os_type": "suse", "http_directory": "http", - "iso_checksum": "58086fca0441b1d44c7a51c5ee64e1bd4365466fcee48ec92c4f39d07739aeed", - "iso_checksum_type": "sha256", - "iso_url": "{{user `mirror`}}/SLE-12-Server-DVD-x86_64-GM-DVD1.iso", - "output_directory": "packer-sles-12-x86_64-parallels", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-parallels", "parallels_tools_flavor": "lin", "prlctl": [ [ @@ -105,7 +105,7 @@ ] ], "prlctl_version_file": ".prlctl_version", - "shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p", + "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", "ssh_password": "vagrant", "ssh_port": 22, "ssh_username": "vagrant", @@ -117,18 +117,18 @@ "boot_command": [ "", "linux netdevice=eth0 netsetup=dhcp install=cd:/", - " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/sles-12/sles-12-x86_64-autoinst.xml", + " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `autoinst_cfg`}}", " textmode=1", "" ], "boot_wait": "10s", "disk_size": 20480, "http_directory": "http", - "iso_checksum": "58086fca0441b1d44c7a51c5ee64e1bd4365466fcee48ec92c4f39d07739aeed", - "iso_checksum_type": "sha256", - "iso_url": "{{user `mirror`}}/SLE-12-Server-DVD-x86_64-GM-DVD1.iso", - "output_directory": "packer-sles-12-x86_64-qemu", - "shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `iso_name`}}", + "output_directory": "packer-{{user `template`}}-qemu", + "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", "ssh_password": "vagrant", "ssh_port": 22, "ssh_username": "vagrant", @@ -150,7 +150,12 @@ "type": "file" }, { - "environment_vars": [], + "environment_vars": [ + "HOME_DIR=/home/vagrant", + "http_proxy={{user `http_proxy`}}", + "https_proxy={{user `https_proxy`}}", + "no_proxy={{user `no_proxy`}}" + ], "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh '{{.Path}}'", "scripts": [ "scripts/common/metadata.sh", @@ -169,15 +174,20 @@ ], "variables": { "arch": "64", + "autoinst_cfg": "sles-12/sles-12-x86_64-autoinst.xml", "box_basename": "sles-12", "build_timestamp": "{{isotime \"20060102150405\"}}", "git_revision": "__unknown_git_revision__", "headless": "", + "http_proxy": "{{env `http_proxy`}}", + "https_proxy": "{{env `https_proxy`}}", + "iso_checksum": "58086fca0441b1d44c7a51c5ee64e1bd4365466fcee48ec92c4f39d07739aeed", + "iso_checksum_type": "sha256", + "iso_name": "SLE-12-Server-DVD-x86_64-GM-DVD1.iso", "metadata": "floppy/dummy_metadata.json", - "mirror": "http://cdn2.novell.com/prot/Q_VbW21BiB4~", + "mirror": "http://cdn.novell.com/prot/1RBC-NrdggI~", "name": "sles-12", "template": "sles-12-x86_64", - "version": "2.0.TIMESTAMP" + "version": "2.2.TIMESTAMP" } } -