packet: Use Ignition config for iPXE installation
MODIFY
packet/flatcar-linux/kubernetes/controllers.tf
packet/flatcar-linux/kubernetes/controllers.tf
@@ -44,7 +44,7 @@ resource "packet_device" "controllers" {
operating_system = "${var.ipxe_script_url != "" ? "custom_ipxe" : format("flatcar_%s", var.os_channel)}"
billing_cycle = "hourly"
project_id = "${var.project_id}"
- user_data = "${element(data.ct_config.controller-ignitions.*.rendered, count.index)}"
+ user_data = "${var.ipxe_script_url != "" ? element(data.ct_config.controller-install-ignitions.*.rendered, count.index) : element(data.ct_config.controller-ignitions.*.rendered, count.index)}"
# If not present in the map, it uses ${var.reservation_ids_default}.
hardware_reservation_id = "${lookup(var.reservation_ids, format("controller-%v", count.index), var.reservation_ids_default)}"

MODIFY
packet/flatcar-linux/kubernetes/workers/workers.tf
packet/flatcar-linux/kubernetes/workers/workers.tf
@@ -8,12 +8,16 @@ resource "packet_device" "nodes" {
project_id = "${var.project_id}"
ipxe_script_url = "${var.ipxe_script_url}"
always_pxe = "false"
- user_data = "${data.ct_config.ignitions.rendered}"
+ user_data = "${var.ipxe_script_url != "" ? data.ct_config.install-ignitions.rendered : data.ct_config.ignitions.rendered}"
# If not present in the map, it uses ${var.reservation_ids_default}.
hardware_reservation_id = "${lookup(var.reservation_ids, format("worker-%v", count.index), var.reservation_ids_default)}"
}
+data "ct_config" "install-ignitions" {
+ content = "${data.template_file.install.rendered}"
+}
+
# These configs are used for the fist boot, to run flatcar-install
data "template_file" "install" {
template = "${file("${path.module}/cl/install.yaml.tmpl")}"

packet: Use Ignition config for iPXE installation