fabrica/.packer/recipes/ubuntu/20.04/packer.json

73 lines
2.4 KiB
JSON
Raw Normal View History

{
"variables": {
"HTTP_PROXY": "{{ env `HTTP_PROXY` }}",
"HTTPS_PROXY": "{{ env `HTTPS_PROXY` }}",
"http_proxy": "{{ env `http_proxy` }}",
"https_proxy": "{{ env `https_proxy` }}",
"packer_images_output_dir": "{{ template_dir }}/../../../images/ubuntu/20.04",
"provisionning_dir": "{{ template_dir }}/../../../provisioning",
"cpus": "2",
"memory": "4096",
"ubuntu_codename": "focal",
"ubuntu_version": "20.04",
"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",
"vm_name": "ubuntu-{{ user `ubuntu_version` }}"
},
"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/legacy-images/SHA256SUMS",
"iso_urls": [ "{{ user `ubuntu_mirror` }}{{ user `ubuntu_codename` }}-updates/main/installer-amd64/current/legacy-images/netboot/mini.iso" ],
"ssh_username": "{{ user `ssh_username` }}",
"ssh_password": "{{ user `ssh_password` }}",
"ssh_wait_timeout": "60m",
"headless": "{{ user `headless` }}",
"output_directory": "{{ template_dir }}/../../../images/ubuntu/20.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": [
"{{ user `provisionning_dir` }}/ubuntu/{{ user `ubuntu_version` }}/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`}}"
]
}
]
}