Refactor
This commit is contained in:
48
packer/sources.pkr.hcl
Normal file
48
packer/sources.pkr.hcl
Normal file
@@ -0,0 +1,48 @@
|
||||
source "hcloud" "main" {
|
||||
image = "ubuntu-18.04"
|
||||
server_type = "cx11"
|
||||
location = "fsn1"
|
||||
|
||||
server_name = "wireguard-{{timestamp}}"
|
||||
snapshot_name = "wireguard-{{timestamp}}"
|
||||
snapshot_labels {
|
||||
service = "wireguard"
|
||||
}
|
||||
|
||||
ssh_port = "22"
|
||||
ssh_username = "root"
|
||||
ssh_timeout = "10m"
|
||||
}
|
||||
|
||||
source "qemu" "main" {
|
||||
iso_url = "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img"
|
||||
iso_checksum_url = "https://cloud-images.ubuntu.com/bionic/current/SHA256SUMS"
|
||||
iso_checksum_type = "sha256"
|
||||
disk_image = true
|
||||
|
||||
vm_name = "wireguard.qcow2"
|
||||
http_directory = "{{template_dir}}/qemu/http/"
|
||||
output_directory = "{{template_dir}}/qemu/dist/"
|
||||
|
||||
accelerator = "kvm"
|
||||
cpus = 1
|
||||
memory = 512
|
||||
headless = true
|
||||
qemuargs {
|
||||
qemuargs = ["-smbios", "type=1,serial=ds=nocloud-net;s=http://{{.HTTPIP}}:{{.HTTPPort}}/seed/"]
|
||||
}
|
||||
|
||||
net_device = "virtio-net"
|
||||
|
||||
format = "qcow2"
|
||||
disk_size = "4G"
|
||||
disk_interface = "virtio"
|
||||
disk_compression = false
|
||||
|
||||
ssh_port = "22"
|
||||
ssh_username = "root"
|
||||
ssh_password = "toor"
|
||||
ssh_timeout = "10m"
|
||||
|
||||
shutdown_command = "shutdown -P now"
|
||||
}
|
Reference in New Issue
Block a user