From 62e50c19ff83e82c9214ef80b8fa19c1ee0aeec4 Mon Sep 17 00:00:00 2001 From: Sandwich Date: Thu, 12 Mar 2026 12:25:45 +0100 Subject: [PATCH] refactor: remove unnecessary changed_when from set_fact tasks --- roles/cleanup/tasks/libvirt.yml | 6 ------ roles/cleanup/tasks/xen.yml | 1 - roles/virtualization/tasks/xen.yml | 1 - 3 files changed, 8 deletions(-) diff --git a/roles/cleanup/tasks/libvirt.yml b/roles/cleanup/tasks/libvirt.yml index 8989aee..40666c8 100644 --- a/roles/cleanup/tasks/libvirt.yml +++ b/roles/cleanup/tasks/libvirt.yml @@ -14,7 +14,6 @@ - name: Initialize cleaned VM XML ansible.builtin.set_fact: cleanup_libvirt_domain_xml: "{{ cleanup_libvirt_get_xml.get_xml }}" - changed_when: false - name: Remove boot ISO device from VM XML (source match) when: boot_iso is defined and boot_iso | length > 0 @@ -28,7 +27,6 @@ when: boot_iso is defined and boot_iso | length > 0 ansible.builtin.set_fact: cleanup_libvirt_domain_xml: "{{ cleanup_libvirt_xml_strip_boot_source.xmlstring }}" - changed_when: false - name: Remove boot ISO device from VM XML (target fallback) community.general.xml: @@ -40,7 +38,6 @@ - name: Update cleaned VM XML after removing boot ISO ansible.builtin.set_fact: cleanup_libvirt_domain_xml: "{{ cleanup_libvirt_xml_strip_boot.xmlstring }}" - changed_when: false - name: Remove cloud-init ISO device from VM XML (source match) community.general.xml: @@ -52,7 +49,6 @@ - name: Update cleaned VM XML after removing cloud-init ISO source match ansible.builtin.set_fact: cleanup_libvirt_domain_xml: "{{ cleanup_libvirt_xml_strip_cloudinit_source.xmlstring }}" - changed_when: false - name: Remove cloud-init ISO device from VM XML (target fallback) community.general.xml: @@ -64,7 +60,6 @@ - name: Update cleaned VM XML after removing cloud-init ISO ansible.builtin.set_fact: cleanup_libvirt_domain_xml: "{{ cleanup_libvirt_xml_strip_cloudinit.xmlstring }}" - changed_when: false - name: Strip XML declaration for libvirt define ansible.builtin.set_fact: @@ -76,7 +71,6 @@ | regex_replace("(?i)encoding=[\"'][^\"']+[\"']", "") | trim }} - changed_when: false - name: Update VM definition without installer media community.libvirt.virt: diff --git a/roles/cleanup/tasks/xen.yml b/roles/cleanup/tasks/xen.yml index aa69d5f..e5c09d9 100644 --- a/roles/cleanup/tasks/xen.yml +++ b/roles/cleanup/tasks/xen.yml @@ -29,7 +29,6 @@ loop_control: label: "{{ item | to_json }}" extended: true - changed_when: false - name: Render Xen VM configuration without installer media vars: diff --git a/roles/virtualization/tasks/xen.yml b/roles/virtualization/tasks/xen.yml index f459688..d87c948 100644 --- a/roles/virtualization/tasks/xen.yml +++ b/roles/virtualization/tasks/xen.yml @@ -23,7 +23,6 @@ loop_control: label: "{{ item | to_json }}" extended: true - changed_when: false - name: Create VM disks for Xen delegate_to: localhost