From 92a04af9900c0db2d0ca602aa8d8232c9aca324a Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 3 Oct 2022 15:30:22 +1300 Subject: [PATCH] add cloud-init templates --- packer/libvirt/arch/arch-minimal.build.pkr.hcl | 2 +- packer/libvirt/arch/arch-minimal.pkrvars.hcl | 13 +++++++++++-- packer/libvirt/arch/templates/meta_data.j2 | 0 packer/libvirt/arch/templates/network_config.j2 | 0 packer/libvirt/arch/templates/user_data.j2 | 0 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 packer/libvirt/arch/templates/meta_data.j2 create mode 100644 packer/libvirt/arch/templates/network_config.j2 create mode 100644 packer/libvirt/arch/templates/user_data.j2 diff --git a/packer/libvirt/arch/arch-minimal.build.pkr.hcl b/packer/libvirt/arch/arch-minimal.build.pkr.hcl index 5c2b57d..5d2df5f 100644 --- a/packer/libvirt/arch/arch-minimal.build.pkr.hcl +++ b/packer/libvirt/arch/arch-minimal.build.pkr.hcl @@ -53,7 +53,7 @@ source "libvirt" "arch-minimal" { volume { alias = "artifact" - name = var.template_name + name = var.volume_name pool = var.volume_pool readonly = false target_dev = "vda" diff --git a/packer/libvirt/arch/arch-minimal.pkrvars.hcl b/packer/libvirt/arch/arch-minimal.pkrvars.hcl index e89f3d8..105e97c 100644 --- a/packer/libvirt/arch/arch-minimal.pkrvars.hcl +++ b/packer/libvirt/arch/arch-minimal.pkrvars.hcl @@ -1,11 +1,13 @@ image_url = "https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2" checksum_url = "https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2.SHA256" -host_ssh_address = "server.balsillie.net" + host_ssh_user = "michael" +host_ssh_address = "server.balsillie.net" + guest_hostname = "arch-minimal-template" cpu_count = 2 memory = 2048 -type = "kvm" +domain_type = "kvm" arch = "x86_64" chipset = "pc-q35-6.1" loader_type = "pflash" @@ -13,6 +15,13 @@ loader_path = "/usr/share/edk2-ovmf/x64/OVMF_CODE.secboot.fd" secure_boot = true nvram_template = "/usr/share/edk2-ovmf/x64/OVMF_VARS.fd" nvram_path_base = "/var/lib/libvirt/qemu/nvram" + +volume_name = "arch_minimal_template" +volume_pool = "default" +volume_capacity = "30G" + +bridge_name = "br0" + guest_ssh_user = "arch" guest_ssh_port = 22 guest_ssh_private_key = "~/.ssh/conf.d/home/arch@arch_template.key" diff --git a/packer/libvirt/arch/templates/meta_data.j2 b/packer/libvirt/arch/templates/meta_data.j2 new file mode 100644 index 0000000..e69de29 diff --git a/packer/libvirt/arch/templates/network_config.j2 b/packer/libvirt/arch/templates/network_config.j2 new file mode 100644 index 0000000..e69de29 diff --git a/packer/libvirt/arch/templates/user_data.j2 b/packer/libvirt/arch/templates/user_data.j2 new file mode 100644 index 0000000..e69de29