13 Commits

Author SHA1 Message Date
Felix Matouschek
c1f651d972 feat(kubevirt_vm): Add support for RunStrategy
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>
2024-07-16 10:20:09 +02:00
Felix Matouschek
060ac97b68 fix(inventory): Fix inventory source caching
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>
2024-07-12 10:32:24 +02:00
Felix Matouschek
fd9c30103d cleanup(inventory): Drop support for multiple connections
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>
2024-07-10 15:32:40 +02:00
Felix Matouschek
5e1271b609 chore(inventory): Add examples for stopped VMs
Add examples that show how to use the collection with stopped VMs.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-07-03 16:04:51 +02:00
Felix Matouschek
77ece9d466 ci: Add yamllint to CI linter job
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>
2024-02-29 11:41:49 +01:00
Felix Matouschek
6ee5a9c7c9 ansible-lint: Groom the .ansible-lint file
- Enable production profile
- Remove excludes no longer necessary
- Try to not skip any tests

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-26 16:31:56 +01:00
Felix Matouschek
6486766b11 kubevirt_vm_info: Add info module for VirtualMachines
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>
2023-09-06 13:04:07 +02:00
Guido Grazioli
198d885b8f ci: integration tests
Signed-off-by: Guido Grazioli <ggraziol@redhat.com>
2023-08-04 15:27:41 +02:00
Felix Matouschek
38c76a9545 Rename collection to kubevirt.core
This replaces all occurences of the old kubernetes.core name.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-08-03 13:03:10 +02:00
Felix Matouschek
bce4f17188 kubevirt_vm: Allow to specify DataVolume templates
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>
2023-07-18 13:40:52 +02:00
Felix Matouschek
6ba62f53e8 kubevirt_vm: Allow to specify template spec
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>
2023-07-18 11:31:32 +02:00
Felix Matouschek
b0971aca37 kubevirt_vm: Use {Instancetype,Preference}Matchers
Use InstancetypeMatchers and PreferenceMatchers directly instead of
providing multiple arguments to prevent unnecessary abstraction.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-07-18 10:41:15 +02:00
Felix Matouschek
216df38df9 first commit
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-07-14 10:30:20 +02:00