Make the logic in the following methods more robust and add type hints
where appropriate.
- get_host_from_service
- get_port_from_service
- is_windows
- setup
- fetch_objects
- set_ansible_host_and_port
- set_composable_vars
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
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>
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>
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>
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 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>