Skip to content

Documentation and Opentofu examples are outdated for Libvirt provider #1996

@tormath1

Description

@tormath1

It has been raised on Slack that documentation for the Opentofu Libvirt provider is outdated. This provider has changed a lot since we wrote the documentation.

A good documentation would look like this:

resource "libvirt_domain" "flatcar_with_file" {
  name        = "flatcar-fwcfg-file-example"
  memory      = 2048
  memory_unit = "MiB"
  vcpu        = 2
  type        = "kvm"

  features {
    acpi = true
  }

  os = {
    type         = "hvm"
    type_arch    = "x86_64"
    type_machine = "q35"
  }

  # Using file attribute to reference an ignition config file
  # NOTE: Currently both file and value must be provided due to schema generation
  # When file is used, value should be empty string
  sys_info = [
    {
      fw_cfg = {
        entry = [
          {
            name = "opt/org.flatcar-linux/config"
            # Reference a file on disk
            file = "/tmp/ignition.json"
            # Value must be provided but can be empty when using file
            value = ""
          }
        ]
      }
    }
  ]
...

The two important things:

  • ACPI feature needs to be enabled for fw_cfg to work
  • value = "" when Ignition is provided via a file

This has to be updated on the Flatcar website (github.com/flatcar/flatcar-website) and in the Flatcar Terraform repository (github.com/flatcar/flatcar-terraform)

Related to: dmacvicar/terraform-provider-libvirt#1202 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🪵Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions