packer-builds

Packer Builds for LXC and Libvirt
git clone https://git.in0rdr.ch/packer-builds.git
Log | Files | Refs | Pull requests |Archive | README

proxmox-centos8.json (2018B)


      1 {
      2   "variables": {
      3     "username": "{{env `PM_USER`}}",
      4     "password": "{{env `PM_PASS`}}",
      5     "api_url": "{{env `PM_API_URL`}}",
      6     "pve_node": "{{env `PM_NODE`}}",
      7     "pve_pool": "{{env `PM_POOL`}}",
      8     "manifest": "manifest.json"
      9   },
     10   "sensitive-variables": ["password"],
     11   "builders": [
     12     {
     13       "type": "proxmox",
     14       "proxmox_url": "{{user `api_url`}}",
     15       "username": "{{user `username`}}",
     16       "password": "{{user `password`}}",
     17       "node": "{{user `pve_node`}}",
     18       "pool": "{{user `pve_pool`}}",
     19       "network_adapters": [
     20         {
     21           "bridge": "vmbr0",
     22           "model": "virtio"
     23         }
     24       ],
     25       "disks": [
     26         {
     27           "disk_size": "5G",
     28           "storage_pool": "local-lvm",
     29           "storage_pool_type": "lvm"
     30         }
     31       ],
     32       "memory": "1024",
     33       "cpu_type": "host",
     34       "scsi_controller": "virtio-scsi-pci",
     35 
     36       "iso_file": "shared:iso/CentOS-8-x86_64-1905-boot.iso",
     37       "os": "l26",
     38       "http_directory":"config",
     39       "boot_wait": "10s",
     40       "boot_command": [
     41         "<up><tab> ip=dhcp inst.cmdline inst.ks=http://{{.HTTPIP}}:{{.HTTPPort}}/ks.cfg<enter>"
     42       ],
     43       "ssh_username": "root",
     44       "ssh_timeout": "15m",
     45       "ssh_password": "root",
     46 
     47       "unmount_iso": true,
     48       "template_name": "centos8-{{ isotime \"20060102-150405\" }}",
     49       "template_description": "CentOS 8, generated on {{ isotime }}"
     50     }
     51   ],
     52   "provisioners": [
     53     {
     54       "type": "shell",
     55       "script": "scripts/cloud-config.sh"
     56     }
     57   ],
     58   "post-processors": [
     59     {
     60       "type": "manifest",
     61       "output": "{{user `manifest`}}",
     62       "strip_path": true
     63     },
     64     {
     65       "script": "scripts/post-process.sh",
     66       "type": "shell-local",
     67       "environment_vars": [
     68         "PM_USER={{user `username`}}",
     69         "PM_PASS={{user `password`}}",
     70         "PM_API_URL={{user `api_url`}}",
     71         "PM_NODE={{user `pve_node`}}",
     72         "PM_POOL={{user `pve_pool`}}",
     73         "PACKER_MANIFEST={{user `manifest`}}"
     74       ]
     75     }
     76   ]
     77 }