Skip to content

feat: enable autostart for runner and k3s VMs#6

Merged
xnoto merged 1 commit into
mainfrom
feat/autostart
May 22, 2026
Merged

feat: enable autostart for runner and k3s VMs#6
xnoto merged 1 commit into
mainfrom
feat/autostart

Conversation

@xnoto
Copy link
Copy Markdown
Contributor

@xnoto xnoto commented May 22, 2026

Summary

  • Sets autostart = true on the runner and k3s module calls, opting both libvirt domains into libvirtd's start-on-boot behavior
  • Consumes the new autostart input added in terraform-libvirt-domain#6
  • router is not managed by this tfroot — its autostart flag was set manually on hero (sudo virsh autostart router)

Test plan

  • opentofu workflow green (validate, fmt, tflint, plan)
  • Plan diff shows + autostart = true on module.runner.libvirt_domain.vm and module.k3s.libvirt_domain.vm, no other in-place updates
  • After apply on hero: sudo virsh dominfo k3s | grep Autostart and runner both report enable

🤖 Generated with Claude Code

Opts the libvirt-managed runner and k3s domains into libvirtd's
start-on-boot behavior via the new autostart input on
terraform-libvirt-domain, replacing any out-of-band virsh autostart.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@xnoto xnoto merged commit d967dfb into main May 22, 2026
1 check passed
@xnoto xnoto deleted the feat/autostart branch May 22, 2026 05:10
@github-actions
Copy link
Copy Markdown

OpenTofu Plan

OpenTofu will perform the following actions:

  # module.k3s.libvirt_cloudinit_disk.commoninit will be created
  + resource "libvirt_cloudinit_disk" "commoninit" {
      + id             = (known after apply)
      + meta_data      = <<-EOT
            instance-id: k3s
            local-hostname: k3s
        EOT
      + name           = "k3s_commoninit"
      + network_config = <<-EOT
            version: 2
            ethernets:
              enp1s0:
                dhcp4: true
              enp2s0:
                dhcp4: false
                addresses:
                  - 192.168.102.2/24
        EOT
      + path           = (known after apply)
      + size           = (known after apply)
      + user_data      = (sensitive value)
    }

  # module.k3s.libvirt_volume.cloudinit will be updated in-place
  ~ resource "libvirt_volume" "cloudinit" {
      ~ allocation = 49152 -> (known after apply)
      ~ capacity   = 49152 -> (known after apply)
      ~ create     = {
          ~ content = {
              ~ url = "/home/user/terraform-provider-libvirt-cloudinit/cloudinit-16de859e0abe38bb.iso" -> (known after apply)
            }
        }
        id         = "/mnt/nvme/cluster/k3s_cloudinit.iso"
        name       = "k3s_cloudinit.iso"
      ~ physical   = 49152 -> (known after apply)
        # (3 unchanged attributes hidden)
    }

  # module.runner.libvirt_cloudinit_disk.commoninit will be created
  + resource "libvirt_cloudinit_disk" "commoninit" {
      + id             = (known after apply)
      + meta_data      = <<-EOT
            instance-id: runner
            local-hostname: runner
        EOT
      + name           = "runner_commoninit"
      + network_config = (sensitive value)
      + path           = (known after apply)
      + size           = (known after apply)
      + user_data      = (sensitive value)
    }

  # module.runner.libvirt_volume.cloudinit will be updated in-place
  ~ resource "libvirt_volume" "cloudinit" {
      ~ allocation = 49152 -> (known after apply)
      ~ capacity   = 49152 -> (known after apply)
      ~ create     = {
          ~ content = {
              ~ url = "/home/user/terraform-provider-libvirt-cloudinit/cloudinit-86070e4489865a53.iso" -> (known after apply)
            }
        }
        id         = "/var/lib/libvirt/images/runner_cloudinit.iso"
        name       = "runner_cloudinit.iso"
      ~ physical   = 49152 -> (known after apply)
        # (3 unchanged attributes hidden)
    }

Plan: 2 to add, 2 to change, 0 to destroy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant