Update the libvirt platform to use fw_cfg_name
Recently Flatcar changed to expect the ignition
config under the name org.flatcar-linux.
The terraform libvirt provider has a commit in
its master branch that allows to set this option.
Use it and document how to build from source for
the mean time.
MODIFY
docs/flatcar-linux/kvm-libvirt.md
docs/flatcar-linux/kvm-libvirt.md
@@ -87,19 +87,28 @@ mv terraform-provider-ct-v0.3.1-linux-amd64/terraform-provider-ct ~/.terraform.d
```
Add the [terraform-provider-libvirt](https://github.com/dmacvicar/terraform-provider-libvirt) plugin binary for your system
-to `~/.terraform.d/plugins/`, noting the `_v0.5.2` suffix.
-You should use the 0.5.2 release because it includes the experimental
-[pool definition feature](https://github.com/dmacvicar/terraform-provider-libvirt/commit/9f00f3d46c489f24c71d02fde816f5fda34d3f7c)
-but building from source is also an option.
+to `~/.terraform.d/plugins/`, noting the `_v0.5.3` suffix. As long as this version is unreleased you have to build the plugin
+yourself. The version must include the `fw_cfg_name` feature as well as the experimental
+[pool definition feature](https://github.com/dmacvicar/terraform-provider-libvirt/commit/9f00f3d46c489f24c71d02fde816f5fda34d3f7c).
-Use the tar file for your distribution when you download it from the [release page](https://github.com/dmacvicar/terraform-provider-libvirt/releases).
-When building from source, you would do a final `mv $GOPATH/bin/terraform-provider-libvirt ~/.terraform.d/plugins/terraform-provider-libvirt_v0.5.2`.
+When building from source, you have to do a final `mv $GOPATH/bin/terraform-provider-libvirt ~/.terraform.d/plugins/terraform-provider-libvirt_v0.5.3`:
```sh
-wget https://github.com/dmacvicar/terraform-provider-libvirt/releases/download/v0.5.2/terraform-provider-libvirt-0.5.2.Fedora_28.x86_64.tar.gz
-# or, e.g., https://github.com/dmacvicar/terraform-provider-libvirt/releases/download/v0.5.2/terraform-provider-libvirt-0.5.2.Ubuntu_18.04.amd64.tar.gz
-tar xzf terraform-provider-libvirt-0.5.2.Fedora_28.x86_64.tar.gz
-mv terraform-provider-libvirt ~/.terraform.d/plugins/terraform-provider-libvirt_v0.5.2
+$ # From any (even temporary) directory
+$ git clone https://github.com/dmacvicar/terraform-provider-libvirt.git
+$ export GO111MODULE=on
+$ export GOFLAGS=-mod=vendor
+$ make install
+$ mv "$GOPATH/bin/terraform-provider-libvirt" ~/.terraform.d/plugins/terraform-provider-libvirt_v0.5.3
+```
+
+In the future you can download the tar file for your distribution from the [release page](https://github.com/dmacvicar/terraform-provider-libvirt/releases):
+
+```sh
+wget https://github.com/dmacvicar/terraform-provider-libvirt/releases/download/v0.5.3/terraform-provider-libvirt-0.5.3.Fedora_28.x86_64.tar.gz
+# or, e.g., https://github.com/dmacvicar/terraform-provider-libvirt/releases/download/v0.5.2/terraform-provider-libvirt-0.5.3.Ubuntu_18.04.amd64.tar.gz
+tar xzf terraform-provider-libvirt-0.5.3.Fedora_28.x86_64.tar.gz
+mv terraform-provider-libvirt ~/.terraform.d/plugins/terraform-provider-libvirt_v0.5.3
```
@@ -143,7 +152,7 @@ provider "tls" {
}
provider "libvirt" {
- version = "~> 0.5.2"
+ version = "~> 0.5.3"
uri = "qemu:///system"
alias = "default"
}

MODIFY
kvm-libvirt/flatcar-linux/kubernetes/controllers.tf
kvm-libvirt/flatcar-linux/kubernetes/controllers.tf
@@ -49,6 +49,7 @@ resource "libvirt_domain" "controller-machine" {
vcpu = "${var.virtual_cpus}"
memory = "${var.virtual_memory}"
+ fw_cfg_name = "opt/org.flatcar-linux/config"
coreos_ignition = "${element(libvirt_ignition.ignition.*.id, count.index)}"
disk {

MODIFY
kvm-libvirt/flatcar-linux/kubernetes/require.tf
kvm-libvirt/flatcar-linux/kubernetes/require.tf
@@ -25,7 +25,7 @@ provider "tls" {
}
provider "libvirt" {
- version = "~> 0.5.2"
+ version = "~> 0.5.3"
uri = "qemu:///system"
}

MODIFY
kvm-libvirt/flatcar-linux/kubernetes/workers/require.tf
kvm-libvirt/flatcar-linux/kubernetes/workers/require.tf
@@ -21,7 +21,7 @@ provider "tls" {
}
provider "libvirt" {
- version = "~> 0.5.2"
+ version = "~> 0.5.3"
uri = "qemu:///system"
}

MODIFY
kvm-libvirt/flatcar-linux/kubernetes/workers/workers.tf
kvm-libvirt/flatcar-linux/kubernetes/workers/workers.tf
@@ -19,6 +19,7 @@ resource "libvirt_domain" "worker-machine" {
vcpu = "${var.virtual_cpus}"
memory = "${var.virtual_memory}"
+ fw_cfg_name = "opt/org.flatcar-linux/config"
coreos_ignition = "${element(libvirt_ignition.ignition.*.id, count.index)}"
disk {

Update the libvirt platform to use fw_cfg_name

Recently Flatcar changed to expect the ignition
config under the name org.flatcar-linux.
The terraform libvirt provider has a commit in
its master branch that allows to set this option.
Use it and document how to build from source for
the mean time.