diff --git a/modules/digitalocean/etcd/ignition.tf b/modules/digitalocean/etcd/ignition.tf new file mode 100644 index 0000000000..e4d74d24fd --- /dev/null +++ b/modules/digitalocean/etcd/ignition.tf @@ -0,0 +1,61 @@ +data "ignition_config" "etcd" { + count = "${var.droplet_count}" + + systemd = [ + "${data.ignition_systemd_unit.locksmithd.id}", + "${data.ignition_systemd_unit.etcd3.*.id[count.index]}", + ] + + files = [ + "${data.ignition_file.node_hostname.*.id[count.index]}", + ] +} + +data "ignition_file" "node_hostname" { + count = "${var.droplet_count}" + path = "/etc/hostname" + mode = 0644 + filesystem = "root" + + content { + content = "${var.cluster_name}-etcd-${count.index}.${var.base_domain}" + } +} + +data "ignition_systemd_unit" "locksmithd" { + count = 1 + name = "locksmithd.service" + enable = true + + dropin = [ + { + name = "40-etcd-lock.conf" + content = "[Service]\nEnvironment=REBOOT_STRATEGY=etcd-lock\n" + }, + ] +} + +data "ignition_systemd_unit" "etcd3" { + count = "${var.droplet_count}" + name = "etcd-member.service" + enable = true + + dropin = [ + { + name = "40-etcd-cluster.conf" + + content = <