debian8.json 2.1 KB
Newer Older
1 2 3 4
{
    "variables": {
        "user": "slapos",
        "password": "slapos",
5
        "domain": "",
6
        "disk_size": "100",
7
        "name": "image",
8
        "custom_script": "scripts/empty.sh"
9 10 11 12 13
    },

    "builders":
    [
        {
14
            "name": "debian8-{{ user `disk_size`}}G-{{ user `name`}}",
15 16 17 18

            "type": "qemu",
            "format": "qcow2",
            "accelerator": "kvm",
19
            "disk_size": "{{ user `disk_size`}}000",
20

21 22
            "iso_url": "http://cdimage.debian.org/mirror/cdimage/archive/8.11.1/amd64/iso-cd/debian-8.11.1-amd64-netinst.iso",
            "iso_checksum": "df0ce86d0b1d81e232ad08eef58754ed",
23 24 25 26 27 28 29 30 31
            "iso_checksum_type": "md5",

            "http_directory": "http",

            "ssh_username": "{{user `user`}}",
            "ssh_password": "{{user `password`}}",
            "ssh_wait_timeout": "1800s",
            "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -h now",

32
            "headless": true,
33 34 35 36 37
            "boot_wait": "2s",
            "boot_command": [
                   "<esc><wait><wait>",
                   "install auto ",
                   "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-debian8.cfg ",
38
                   "debian-installer=en_US locale=en_US keymap=fr ",
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
                   "netcfg/get_hostname={{ .Name }} ",
                   "netcfg/get_domain={{ user `domain`}} ",

                   "fb=false debconf/frontend=noninteractive ",

                   "passwd/user-fullname={{user `user`}} ",
                   "passwd/user-password={{user `password`}} ",
                   "passwd/user-password-again={{user `password`}} ",
                   "passwd/username={{user `user`}} ",

                   "<enter>"
            ]
        }
    ],

    "provisioners": [
        {
            "type": "shell",
            "execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
            "scripts": [
                "scripts/update.sh",
                "scripts/packages.sh",
61 62
                "scripts/cleanup.sh",
                "{{ user `custom_script` }}"
63 64 65 66
            ]
        }
    ]
}
67