This change adds support for setting the RunStrategy of a VM.
Depending on the value set the wait condition for the VM is adjusted.
For the values Always, RerunOnFailure or Once the wait condition will
wait for the VM to run and be ready. For the value Halted the wait
condition will wait for the VM to not exist. For the value Manual
the wait condition is not set.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Fix inventory source caching by separating the fetching of objects and
populating the inventory. This way objects can be fetched from the K8S
API or from a configured cached and the cache related parameters on the
plugin now actually work.
The inventory source cache was tested with the ansible.builtin.jsonfile
cache plugin and 100k hosts (~2G JSON file). Though it took a noticeable
amount of time for the inventory plugin to run it worked fine and no
failures could be observed.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
The support for connections to multiple clusters in the inventory
plugin is dropped to better align with user expectations and how other
inventories work. If inventories of multiple clusters are needed the
inventory can be run multiple times with different configurations.
This also helps to clean up the code and make it simpler.
For now this adds a compatibility helper so that configurations with a
single connection entry remain supported and a warning is emitted.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This adds yamllint to the CI linter job and sets the maximum line
length to 140 like in kubevirt/kubevirt.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This adds the kubevirt_vm_info module, which returns the same results as
the kubevirt_vm module, but is limited to read-only functionality.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
By allowing to specify DataVolume templates VMs with persistent storage
can be created using the kubevirt_vm module.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
By allowing to specify the template spec unnecessary abstraction is
avoided.
The following module args are replaced by the 'spec' arg:
- termination_grace_period
- interfaces
- networks
- volumes
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Use InstancetypeMatchers and PreferenceMatchers directly instead of
providing multiple arguments to prevent unnecessary abstraction.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>