Add ubuntu18
* Info about Ubiquity https://wiki.ubuntu.com/UbiquityAutomation
- we do exactly partitioning=> no possibility for now, to use
new installer type.
* Move growlvm.py to commons
Change-Id: Iabda3770b368a48919fef89d3a78cae388f60168
Prod-related: PROD-28155 (PROD:28155)
diff --git a/ubuntu-18.04/template.json b/ubuntu-18.04/template.json
new file mode 100644
index 0000000..b3a97e6
--- /dev/null
+++ b/ubuntu-18.04/template.json
@@ -0,0 +1,111 @@
+{
+ "variables": {
+ "user": "root",
+ "password": "r00tme",
+ "disk_size": "10000",
+ "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
+ "mirror_hostname": "{{ env `MIRROR_HOSTNAME` }}",
+ "mirror_directory": "{{ env `MIRROR_DIRECTORY` }}",
+ "ubuntu_baseurl": "http://{{ env `MIRROR_HOSTNAME`}}/{{ env `MIRROR_DIRECTORY` }}/",
+ "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
+ "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
+ "do_api_token": "{{ env `DO_API_TOKEN` }}",
+ "image_name": "{{ env `IMAGE_NAME` }}"
+ },
+ "provisioners": [
+ {
+ "type": "shell-local",
+ "command": "cp -av ../common/files/scripts/growlvm.py files/scripts/growlvm.py"
+ },
+ {
+ "type": "shell",
+ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }};",
+ "expect_disconnect": "true",
+ "environment_vars": [
+ "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
+ "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
+ "SALTSTACK_REPO={{ user `saltstack_repo` }}"
+ ],
+ "override": {
+ "qemu": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/motd.sh",
+ "scripts/salt.sh",
+ "scripts/network.sh",
+ "scripts/security.sh",
+ "scripts/cleanup.sh",
+ "scripts/info.sh",
+ "scripts/zerodisk.sh"
+ ]
+ }
+ }
+ },
+ {
+ "type": "file",
+ "source": "files/etc/",
+ "destination": "/etc"
+ },
+ {
+ "type": "file",
+ "source": "files/scripts/",
+ "destination": "/usr/bin"
+ }
+ ],
+ "builders": [
+ {
+ "type": "qemu",
+ "qemuargs": [
+ ["-m", "2048M"]
+ ],
+ "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2",
+ "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
+ "disk_compression": true,
+ "disk_size": "{{ user `disk_size`}}",
+ "accelerator": "kvm",
+ "iso_checksum": "34416ff83179728d54583bf3f18d42d2",
+ "iso_checksum_type": "md5",
+ "iso_url": "http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/ubuntu-18.04.2-server-amd64.iso",
+ "iso_target_path": "{{ user `images_cache` }}/ubuntu-18.04.2-server-amd64.iso",
+ "http_directory": "http",
+ "headless": true,
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "shutdown_command": "sync; sudo /sbin/shutdown -hP now",
+ "boot_wait": "2s",
+ "ssh_timeout": "20m",
+ "ssh_host_port_min": 7050,
+ "ssh_host_port_max": 7060,
+ "vnc_port_min": 5930,
+ "vnc_port_max": 5930,
+ "boot_command": [
+ "<esc><down><wait><f6><esc><wait>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+ " initrd=/install/hwe-initrd.gz",
+ " edd=on nodmraid nomodeset acpi=off",
+ " console-setup/ask_detect=false",
+ " console-setup/layoutcode=us",
+ " console-setup/modelcode=pc105",
+ " debconf/frontend=noninteractive",
+ " debian-installer=en_US",
+ " fb=false",
+ " kbd-chooser/method=us",
+ " keyboard-configuration/layout=USA",
+ " keyboard-configuration/variant=USA",
+ " netcfg/get_hostname=ubuntu netcfg/get_domain=local",
+ " locale=en_US",
+ " mirror/http/hostname={{ user `mirror_hostname` }} mirror/http/directory={{ user `mirror_directory` }}",
+ " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg --- ",
+ "<enter><wait>"
+ ]
+ }
+ ]
+}