packer-templates/ubuntu2004/packer.json
2023-01-16 21:44:18 +01:00

71 lines
2 KiB
JSON

{
"variables": {
"proxmox_username": "",
"proxmox_password": "",
"proxmox_url": "",
"proxmox_node": "",
"proxmox_storage_pool": "local-lvm",
"proxmox_storage_pool_type": "lvm-thin",
"proxmox_storage_format": "raw",
"proxmox_iso_pool": "local:iso",
"ubuntu_image": "ubuntu-20.04.5-live-server-amd64.iso",
"template_name": "Ubuntu-20.04-Template",
"template_description": "Ubuntu 20.04 Template",
"version": ""
},
"builders": [
{
"type": "proxmox",
"username": "{{user `proxmox_username`}}",
"password": "{{user `proxmox_password`}}",
"proxmox_url": "{{ user `proxmox_url`}}",
"insecure_skip_tls_verify": true,
"node": "{{user `proxmox_node`}}",
"os": "l26",
"boot_command": [
"<enter><enter><f6><esc><wait> ",
"autoinstall ds=nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/",
"<enter><wait>"
],
"network_adapters": [
{
"bridge": "vmbr0",
"model": "virtio"
}
],
"disks": [
{
"type": "scsi",
"disk_size": "8G",
"storage_pool": "{{user `proxmox_storage_pool`}}",
"storage_pool_type": "{{user `proxmox_storage_pool_type`}}",
"format": "{{user `proxmox_storage_format`}}"
}
],
"scsi_controller": "virtio-scsi-single",
"iso_file": "{{user `proxmox_iso_pool`}}/{{user `ubuntu_image`}}",
"boot_wait": "5s",
"cores": "2",
"memory": "2048",
"http_directory": "ubuntu2004/http",
"ssh_username": "ubuntu",
"ssh_password": "ubuntu",
"ssh_port": 22,
"ssh_timeout": "30m",
"unmount_iso": true,
"template_name": "{{user `template_name`}}",
"template_description": "{{user `template_description`}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo rm -f /etc/cloud/cloud.cfg.d/99-installer.cfg",
"sudo cloud-init clean",
"sudo passwd -d ubuntu"
],
"only": ["proxmox"]
}
]
}