Change the license of the collection to Apache 2.0 to be compliant with
the CNCF licensing requirements.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Drop the vendored document fragments from kubernetes.core to slightly
enhance the documented options and to allow changing the license of the
collection.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Ensure compatibility with kubernetes.core >=3.10,<4.1.0 by replacing
deprecated imports of HAS_K8S_MODULE_HELPER and k8s_import_exception.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Fix the for loop ranging over vmi labels. This loop is missing the
.items() statement, which it causes the following error:
```
for key, value in vmi.metadata.labels:
ValueError: too many values to unpack (expected 2)
```
Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
Improve the generated documentations by adding Ansible documentation markup
where appropriate.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Add the running parameter to kubevirt_vm_info from which the
wait_condition is derived from when parameter wait is set to
yes.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
To properly wait for a state change in the kubevirt_vm module the
wait_condition needs to adapted to the state of running.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Cleanup the YAML passed to the k8s module so it conforms to yaml output
you would expect from yaml.dump. Also refactor the tests to get rid of
duplicate definitions and make use of pytest.mark.parametrize and
yaml.dump.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This changes the inventory plugin so that it sets the ansible_connection
to winrm if it detected a Windows host. If it did not detect a Windows
host the ansible_connection is no longer set, so Ansible falls back to
its default value of ssh. The detection of SSH services for hosts using
winrm is disabled.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Docs seem to indicate compose variables should work, but they aren't actually set.
Fix that by adding the composite variables to the inventory.
Signed-off-by: matt <l3acon@gmail.com>
To give secondary interfaces a higher priority over services the use of
services is disabled if a network_name was provided.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This option allows to append the base domain of a cluster to host names
constructed from SSH services of type NodePort. Also add the missing
documentation for option base_domain.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Explicitly set ansible_port so it is reset in AWX inventories if the
value changes from set to unset.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Vendor the kubernetes.core doc_fragments used by this collection because
it is not possible to refer to doc_fragments of dependency collections.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Bump the dependency on kubernetes.core to versions >=3.0.1 and remove
the workaround introduced by 4429ac8c03.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Update the requirements throughout the project to be in sync and to
reflect the current state of dependencies.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Since the minimum required version of the kubernetes python client was
updated to a version not requiring this workaround anymore, the
workaround is replaced with the to_dict() method found in the new
client.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Update README.md to include all modules of the collection and keep
module descriptions in sync.
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>
Ensure compatibility with KubeVirt >=1.1.0 by monkey patching
kubernetes.core to handle apis of the format a/b/c and requiring
kubernetes>=28.1.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>
This removes the unnecessary whitespace from the rendered VirtualMachine
template and adds a unit test for it.
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>