centos-7.2.json 1.64 KB
Newer Older
1 2 3 4
{
    "variables": {
        "user": "slapos",
        "password": "slapos",
5 6 7 8
        "domain": "",
        "disk_size": "200",
        "name": "image",
        "custom_script": ""
9 10 11 12 13
    },

    "builders":
    [
        {
14
            "name": "centos7.2-{{ 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 23 24 25 26 27 28 29 30 31

            "iso_url": "http://mirrors.kernel.org/centos/7.2.1511/isos/x86_64/CentOS-7-x86_64-NetInstall-1511.iso",
            "iso_checksum": "9ed9ffb5d89ab8cca834afce354daa70a21dcb410f58287d6316259ff89758f5",
            "iso_checksum_type": "sha256",

            "http_directory": "http",

            "ssh_username": "{{user `user`}}",
            "ssh_password": "{{user `password`}}",
            "ssh_wait_timeout": "1800s",
            "shutdown_command": "sudo poweroff",

32
            "headless": true,
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
            "boot_wait": "2s",
            "boot_command": [
              "<esc>",
              "<wait>",
              "linux ks=http://{{.HTTPIP}}:{{.HTTPPort}}/centos72-anaconda-ks.cfg biosdevname=0 net.ifnames=0",
              "<enter>"
            ]
        }
    ],

    "provisioners": [
        {
            "type": "shell",
            "execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
            "scripts": [
                "scripts/update-centos.sh",
                "scripts/packages-centos.sh",
50 51 52
                "scripts/cleanup-centos.sh",
                "scripts/centos7-install-base.sh",
                "{{ user `custom_script` }}"
53 54 55 56
            ]
        }
    ]
}
57