fabrica/.packer/recipes/ubuntu/18.04/packer.json

72 lines
2.3 KiB
JSON

{
"variables": {
"HTTP_PROXY": "{{ env `HTTP_PROXY` }}",
"HTTPS_PROXY": "{{ env `HTTPS_PROXY` }}",
"http_proxy": "{{ env `http_proxy` }}",
"https_proxy": "{{ env `https_proxy` }}",
"vm_name": "ubuntu-18.04",
"packer_images_output_dir": "{{ template_dir }}/../../../images/ubuntu/18.04",
"cpus": "2",
"memory": "4096",
"ubuntu_codename": "bionic",
"ubuntu_mirror": "http://archive.ubuntu.com/ubuntu/dists/",
"ssh_username": "root",
"ssh_password": "cadoles",
"preseed_file_name": "preseed-minimal.cfg",
"disk_size": "10240",
"headless": "true"
},
"builders":
[
{
"name": "{{ user `vm_name` }}",
"vm_name": "{{ user `vm_name` }}.img",
"type": "qemu",
"iso_checksum": "file:{{ user `ubuntu_mirror` }}{{ user `ubuntu_codename` }}-updates/main/installer-amd64/current/images/SHA256SUMS",
"iso_urls": [ "{{ user `ubuntu_mirror` }}{{ user `ubuntu_codename` }}-updates/main/installer-amd64/current/images/netboot/mini.iso" ],
"ssh_username": "{{ user `ssh_username` }}",
"ssh_password": "{{ user `ssh_password` }}",
"vnc_bind_address": "0.0.0.0",
"ssh_wait_timeout": "60m",
"headless": "{{ user `headless` }}",
"output_directory": "{{ template_dir }}/../../../images/ubuntu/18.04",
"accelerator": "kvm",
"cpus": "{{ user `cpus` }}",
"memory": "{{user `memory`}}",
"boot_wait": "5s",
"boot_command":
[
"<tab>",
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{ user `preseed_file_name` }} ",
"auto=true ",
"language=fr ",
"country=FR ",
"locale=fr_FR.UTF-8 ",
"method=fr ",
"net.ifnames=0 ",
"hostname={{user `vm_name` }} ",
"<enter>"
],
"disk_size": "{{ user `disk_size` }}",
"disk_additional_size": [ "10G", "20G", "30G", "40G", "50G", "60G" ],
"http_directory": "{{template_dir}}/http"
}
],
"provisioners": [
{
"type": "shell",
"scripts": [
"{{ template_dir }}/scripts/provision-minimal.sh"
],
"environment_vars": [
"VM_NAME={{user `vm_name`}}",
"HTTP_PROXY={{user `HTTP_PROXY`}}",
"HTTPS_PROXY={{user `HTTPS_PROXY`}}",
"http_proxy={{user `http_proxy`}}",
"https_proxy={{user `https_proxy`}}"
]
}
]
}