csmart / ansible-role-virt-infra

Define and manage guests and networks on a KVM host with Ansible
GNU General Public License v3.0
68 stars 48 forks source link

add support for keeping disks #10

Closed csmart closed 4 years ago

csmart commented 4 years ago

This change adds the ability to keep a disk rather than delete it when a guest is undefined.

This adds a new 'keep' disk config item. Setting this to true will cause the disk to be skipped when the machine is undefined.

If this is the boot disk, then if you re-create the same guest after it's deletion, the disk will not have sysprep run on it, or cloud-init, etc installed.

Thus, you can set 'keep = true' on the boot disk and after the first time it's created it will remain the same over subsequent guest deletes and recreates.