vault kv put secrets/packer/win10圆4 vault kv get secrets/packer/win10圆4.Vault will accept secret key-value pairs from a JSON which I provided with NON-secret values.
Since a majority of these values are not secret I provided a vault-win10圆4-vars.json which can make the process easier.
- Define if Packer should validate the TLS certificate.
- vault kv patch secrets/proxmox proxmox_skip_tls_verify=false.
- vault kv patch secrets/proxmox proxmox_password=changeme.
- vault kv patch secrets/proxmox Set the Proxmox username.
- vault kv patch secrets/proxmox proxmox_host=.
- vault kv put secrets/proxmox proxmox_url=.
- Attach the policies to their respective users.
- Add the admin policy for Packer secrets.
- vault policy write packer-admin vault_policies/admin.hcl.
- Add the read-only policy for Packer secrets.
- vault policy write packer-read-only vault_policies/read-only.hcl.
- vault secrets enable -version=2 -path=secrets kv.
- If you want to take a look at how to integrate Vault into your Packer builds keep reading. If your environment does not have Vault you can replace all with actual values and you can skip this section. Lately, I have been integrating Vault into a lot of my projects and I am continuing that here. If you prefer the ISO URL download method skip this section. Since the network for my Proxmox instance has 1GB down it takes seconds to download a 4GB ISO onto Proxmox directly. Since my server is remote I have a 5MB upload speed to my server, which takes about two hours to upload the ISO to Proxmox. Next, Packer has to upload the ISO to Proxmox. You can instruct Packer to download the ISO via a URL but for Windows, I find this process tedious, First, Packer has to download it locally on the machine Packer is being executed on.
Setup Proxmox Download Windows and Windows VirtoIO driver ISOs Make sure the version is 1.6.3 or higher.Packer is an open-source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Lastly, I will be using Vault to store my sensitive values required by Packer to create this VM. By converting an Autounattend.xml file to an ISO we can now mount the ISO to install the OS and the ISO containing the necessary file to automate the installation. Since Proxmox doesn’t support virtual floppy drives you can’t supply an Autounattend.xml file to automate the installation and initial configuration of Windows.
This new feature provides the ability to mount multiple ISOs on Proxmox VMs because Proxmox “doesn’t” support virtual floppy drives. This blog post is going to demonstrate how to implement a new feature added to Packer in version 1.6.3.