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

80 lines
2.4 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",
"centos_image": "Rocky-9.0-x86_64-dvd.iso",
"template_name": "RL9-Template",
"template_description": "Rocky Linux 9 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": [
"<tab> text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/inst.ks<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 `centos_image`}}",
"boot_wait": "10s",
"cores": "2",
"cpu_type": "Nehalem",
"memory": "2048",
"http_directory": "rocky9",
"ssh_username": "root",
"ssh_password": "Packer",
"ssh_port": 22,
"ssh_timeout": "15m",
"unmount_iso": true,
"template_name": "{{user `template_name`}}",
"template_description": "{{user `template_description`}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"yum install -y cloud-init qemu-guest-agent cloud-utils-growpart gdisk",
"systemctl enable qemu-guest-agent",
"shred -u /etc/ssh/*_key /etc/ssh/*_key.pub",
"rm -f /var/run/utmp",
">/var/log/lastlog",
">/var/log/wtmp",
">/var/log/btmp",
"rm -rf /tmp/* /var/tmp/*",
"unset HISTFILE; rm -rf /home/*/.*history /root/.*history",
"rm -f /root/*ks",
"passwd -d root",
"passwd -l root",
"rm -f /etc/ssh/ssh_config.d/allow-root-ssh.conf"
],
"only": ["proxmox"]
}
]
}