ubuntu1804.json 1.32 KB
Newer Older
1
{
2
3
4
5
6
7
8
9
10
11
12
13
    "builders": [
        {
            "type": "qemu",
            "communicator": "ssh",
            "headless": true,
            "disk_image": true,
            "cpus": "{{ user `cpus` }}",
            "memory": "{{ user `memory` }}",
            "iso_checksum": "file:https://cloud-images.ubuntu.com/bionic/current/SHA256SUMS",
            "iso_url": "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img",
            "qemuargs": [
                ["-smbios", "type=1,serial=ds=nocloud-net;instance-id=packer;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/"],
14
                ["-machine","pc-q35-4.2,accel=kvm:tcg,usb=off,vmport=off,dump-guest-core=off"]
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
            ],
            "http_directory": "scripts",
            "ssh_username": "ubuntu",
            "ssh_password": "ubuntu",
            "net_device": "virtio-net",
            "shutdown_command": "sudo shutdown --poweroff --no-wall now",
            "output_directory": "output-ubuntu1804",
            "vm_name": "ubuntu1804"
        }
    ],
    "provisioners": [
      {
        "type": "shell",
        "execute_command": "{{.Vars}} sudo -S -E bash '{{.Path}}'",
        "scripts": [
            "scripts/packages.sh",
            "scripts/cleanup.sh"
32
        ]
33
34
35
36
37
      }
    ],
    "variables": {
        "cpus": "4",
        "memory": "4096"
38
39
    }
}