dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.54k stars 457 forks source link

A change to libvirt_ignition should result in libvirt_domain being recreated #854

Open anthr76 opened 3 years ago

anthr76 commented 3 years ago

System Information

Arch Linux toolbox

Linux distribution

cat /etc/os-release 
NAME=Fedora
VERSION="34.20210516.0 (Silverblue)"
ID=fedora
VERSION_ID=34
VERSION_CODENAME=""
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34.20210516.0 (Silverblue)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:34"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora-silverblue/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=34
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=34
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Silverblue"
VARIANT_ID=silverblue
OSTREE_VERSION='34.20210516.0'

Terraform version

Terraform v0.15.4
on linux_amd64
+ provider registry.terraform.io/carlpett/sops v0.6.2
+ provider registry.terraform.io/cloudflare/cloudflare v2.21.0
+ provider registry.terraform.io/dmacvicar/libvirt v0.6.3
+ provider registry.terraform.io/poseidon/ct v0.8.0

Provider and libvirt versions

v0.6.3

Checklist

Description of Issue/Question

When performing CRUD on a ignition file the libvirt domain needs to be recycled. Currently all we do is update the file in place.

Setup

https://github.com/anthr76/kubic-terraform-kvm/blob/02c22a816cca1e9815ef97b4842d797d4b7f3a65/masters.tf#L66-L70

Steps to Reproduce Issue

https://github.com/anthr76/kubic-terraform-kvm/blob/02c22a816cca1e9815ef97b4842d797d4b7f3a65/masters.tf#L66-L70

Changes here result in the file being updated but the domain not changing

I have tested this against kubic, and Fedora CoreOS

Per https://coreos.github.io/ignition/rationale/#ignition-runs-only-on-the-first-boot we should be recycling the resources of the updated ignition