Add the kubevirt_vmi_info module which allows to fetch information about
VirtualMachineInstance(s).
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Run the integration tests for kubevirt_vm_info in a random namespace
and cleanup after the tests finish.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Run the integration tests for kubevirt_vm in a random namespace
and cleanup after the tests finish.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Run the integration tests for inventory_kubevirt in a random namespace
and cleanup after the tests finish.
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>
Fix the assertion that was introduced in
2521e8ba24 by removing the superfluous 'd'
at the end of the variable names.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Assert there are no or expected changes in verify.yml of the kubevirt_vm
integration test. This is necessary since in downstream tests the
kubemacpool operator might add annotations to the VM which can trigger a
changed result.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This changes the runme.sh of the kubevirt_vm integration tests to retry
the connection to the VM until a login is possible. This is necessary
since it is not possible with Ansible alone to retry a task in case the
connection failed with the unreachable status. This can happen when the
sshd of the VM already accepts connections but a login is not yet
possible because the VM is still booting up.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Rework gitignore by combining all gitignore files and adding files
generated by running tests.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Cleanup the created the created VMs after the inventory integration
tests collected the inventory test results to not leave running VMs
behind after the test finished.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
- Use uniform way of naming plays, tasks and VMs
- Use uniform way of ordering task parameters
- Use defaults where possible
- Use CentOS 9 Stream instancetype and preference
- Generate SSH private key with empty password (-N "")
- Disable strict host key checking
- Add .gitignore for test files
- Fix skipping test key creation if already existent
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
- Use uniform way of naming plays, tasks and VMs
- Use uniform way of ordering task parameters
- Use defaults where possible
- Use CentOS Stream 9 as VM OS
- Drop unneeded environment variables
- Use FQCN of Ansible modules
- Add missing test for empty inventory
- Add .gitignore for test files
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Remove { } from runme.sh files to avoid failures being masked.
Re-add install of ansible.posix to have the
ansible.posix.profile_task callback available.
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>
Bump the software versions defined in hack/e2e-setup.sh to the latest
ones and sync version installed of kind in github integration tests
with e2e-setup.sh. Update the CentOS 9 Stream preference name used in
the tests to the new name in common-instancetypes v0.4.0.
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>
This adds the create_groups option to the inventory, which allows to
control the creation of groups from labels on VirtualMachines. By
default it is disabled.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>