diff --git a/examples/hcl/ubuntu/README.md b/examples/hcl/linux/README.md similarity index 100% rename from examples/hcl/ubuntu/README.md rename to examples/hcl/linux/README.md diff --git a/examples/hcl/linux/build.alpine.pkr.hcl b/examples/hcl/linux/build.alpine.pkr.hcl new file mode 100644 index 000000000..156a1d159 --- /dev/null +++ b/examples/hcl/linux/build.alpine.pkr.hcl @@ -0,0 +1,42 @@ + +build { + name = "alpine" + description = </usr/local/bin/shutdown <" ] } + + +source "vsphere-iso" "base-alpine-amd64" { + vcenter_server = var.vcenter_endpoint + username = var.vcenter_user + password = var.vcenter_password + host = var.esxi_host + insecure_connection = true + + datacenter = var.datacenter_name + datastore = "datastore1" + + ssh_username = "root" + ssh_password = var.alpine_password + + CPUs = 1 + RAM = 512 * 2 + RAM_reserve_all = true + + guest_os_type = "otherLinux64Guest" + + floppy_files = local.floppy_files_alpine_vsphere + + network_adapters { + network = "VM Network" + network_card = "vmxnet3" + } + + storage { + disk_size = 32768 + disk_thin_provisioned = true + } +} diff --git a/examples/hcl/ubuntu/variables.16.04.pkr.hcl b/examples/hcl/linux/variables.16.04.pkr.hcl similarity index 100% rename from examples/hcl/ubuntu/variables.16.04.pkr.hcl rename to examples/hcl/linux/variables.16.04.pkr.hcl diff --git a/examples/hcl/ubuntu/variables.18.04.pkr.hcl b/examples/hcl/linux/variables.18.04.pkr.hcl similarity index 100% rename from examples/hcl/ubuntu/variables.18.04.pkr.hcl rename to examples/hcl/linux/variables.18.04.pkr.hcl diff --git a/examples/hcl/linux/variables.alpine.pkr.hcl b/examples/hcl/linux/variables.alpine.pkr.hcl new file mode 100644 index 000000000..62c0e47cb --- /dev/null +++ b/examples/hcl/linux/variables.alpine.pkr.hcl @@ -0,0 +1,56 @@ + +variable "alpine_password" { + type = string + default = "alpine" +} + +locals { + iso_url_alpine_312 = "http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-virt-3.12.0-x86_64.iso" + iso_checksum_url_alpine_312 = "http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-virt-3.12.0-x86_64.iso.sha256" + floppy_files_alpine = [ + "${local.http_directory}/alpine-answers", + "${local.http_directory}/alpine-setup.sh" + ] + + alpine_312_floppy_boot_command = [ + "root", + "mount -t vfat /dev/fd0 /media/floppy", + "setup-alpine -f /media/floppy/alpine-answers", + "", + "${var.alpine_password}", + "${var.alpine_password}", + "", + "y", + "", + "reboot", + "", + "root", + "${var.alpine_password}", + "mount -t vfat /dev/fd0 /media/floppy", + "/media/floppy/alpine-setup.sh", + ] + + floppy_files_alpine_vsphere = [ + "${local.http_directory}/alpine-vsphere-answers", + "${local.http_directory}/alpine-setup.sh" + ] + + alpine_312_floppy_boot_command_vsphere = [ + "root", + "mount -t vfat /dev/fd0 /media/floppy", + "setup-alpine -f /media/floppy/alpine-vsphere-answers", + "${var.alpine_password}", + "${var.alpine_password}", + "", + "y", + "", + "reboot", + "", + "root", + "${var.alpine_password}", + "mount -t vfat /dev/fd0 /media/floppy", + "/media/floppy/alpine-setup.sh", + "", + ] + +} diff --git a/examples/hcl/ubuntu/variables.common.pkr.hcl b/examples/hcl/linux/variables.common.pkr.hcl similarity index 100% rename from examples/hcl/ubuntu/variables.common.pkr.hcl rename to examples/hcl/linux/variables.common.pkr.hcl