Commit Graph
88 Commits
Author SHA1 Message Date
Felix Matouschek ac589abf5e chore: Add vscode configuration
Add vscode configuration that allows to develop, test and debug the
collection.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-12 10:29:58 +02:00
Felix Matouschek 55a6acef5d chore: Add tox-ansible configuration
Add tox-ansible configuration that allows to run tests with all
required ansible and python versions. Add Makefile targets to make use
of it.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-12 10:29:54 +02:00
Felix Matouschek e2d2da2670 chore: Add tox configuration
Add tox configuration that allows to build a venv for development and to
format source files. To make use of it add appropriate Makefile targets.

Drop unneeded requirements from requirements.txt and
test-requirements.txt and add needed requirements.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-12 10:23:38 +02:00
Felix Matouschek 7dc7312a8b feat: Give secondary interfaces a higher priority over services
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>
2024-04-05 14:35:44 +02:00
Felix Matouschek 61d631de9a tests: Add --create-registry to hack/e2e-setup.sh
With this change hack/e2e-setup.sh configures a local registry when the
--create-registry argument is passed to it. This registry can be used to
test local images. The registry is optional and not created by default.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-05 09:51:05 +02:00
Felix Matouschek 3560818167 fix: Return early to avoid adding empty groups.
If no VMIs were found in a namespace then return early to avoid adding
empty groups.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-05 09:44:38 +02:00
Felix Matouschek ae17f5cc57 feat: Add append_base_domain option to connections
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>
2024-04-03 16:34:07 +02:00
Felix Matouschek b7009ede7d chore: Update CHANGELOG.rst
Update CHANGELOG.rst to conform to semantic versioning of the
collection.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-03 15:52:51 +02:00
Felix Matouschek 9f33a3059c fix: Explicity set ansible_port
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>
2024-04-03 15:39:42 +02:00
Felix Matouschek a020730ba7 cleanup: Correct changelog
Move the introduction of kubevirt_vm_info from major to minor since it
did not break API compatibility or compatibility with existing playbooks.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-21 16:22:48 +01:00
Felix Matouschek db874e61bc cleanup: Add reference to release policy to README.md
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-21 16:21:28 +01:00
Felix Matouschek 1772f182e0 chore: Rework gitignore
Rework gitignore by combining all gitignore files and adding files
generated by running tests.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-20 10:19:13 +01:00
Felix Matouschek 651e1d6718 fix: Rename tests/config.yaml to tests/config.yml
The file extension of the file needs to be .yml, so ansible-test is able
to pick it up.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-20 09:19:28 +01:00
Felix Matouschek 426b9ce2f2 galaxy.yml: Add .gitignores to build_ignore
Add .gitignore files to build_ignore since we do not need them in the
released collection.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-19 17:52:37 +01:00
Felix MatouschekandGitHub 6c4e65005c Merge pull request #64 from 0xFelix/fix-cleanup-names
chore: Fix names in inventory cleanup

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-18 17:23:40 +01:00
Felix Matouschek 41751fe432 chore: Fix names in inventory cleanup
We are deleting VMs, not creating VMs. Therefore change the names to
reflect that.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-18 17:21:52 +01:00
Felix Matouschek eb2291692d tests: Cleanup after inventory test
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>
2024-03-18 17:00:53 +01:00
Felix Matouschek 09ef2be0fd chore: Bump version to 1.2.3
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-18 16:51:30 +01:00
Felix Matouschek 232d802080 chore: Update requires_ansible placeholder in README.md
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-11 15:41:04 +01:00
Felix Matouschek 2a6255233e docs: Update inventory matches on string
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-11 15:14:12 +01:00
Felix Matouschek 9bc46c4017 docs: Update links to KubeVirt API reference
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-11 15:07:22 +01:00
Felix Matouschek 939758a057 galaxy.yaml: Update build_ignore again
Remove CONTRIBUTING.md from build_ignore and add docs/requirements.txt
to build_ignore.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-11 14:41:02 +01:00
Felix Matouschek 4ed26acd33 docs: Update link to kubernetes.core collection in README.md
Update link to kubernetes.core collection in the README.md and add tags
for downstream customization of README.md

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-11 14:33:15 +01:00
Felix Matouschek 7f4f23f60f chore: Bump version to 1.2.2
Bump version to 1.2.2 and add release summary.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-11 13:51:18 +01:00
Felix Matouschek 660c75eae3 chore: Vendor kubernetes.core doc_fragments
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>
2024-03-11 13:41:01 +01:00
Felix Matouschek 926989e7ef cleanup: Remove unneeded inventory file
Remove unneeded tests/integration/inventory file, which likely got added
by accident.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-11 13:13:43 +01:00
Felix Matouschek a9fdfe49b7 galaxy.yaml: Update build_ignore
Ignore additional files we do not want to be part of the released
collection. Also ignore build artifacts in .gitignore.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-11 11:25:58 +01:00
Felix Matouschek 8c338c525a chore: Update README.md
Update README.md to include kubernetes.core collection version and
simplify install command.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-05 15:02:30 +01:00
Felix Matouschek 57af633431 fix: Ignore generated files in yamllint
Ignore errors found by yamllint in generated files.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-05 14:39:30 +01:00
Felix Matouschek 4c8260d6de chore: Bump version to 1.2.1
Bump version to 1.2.1 and include a change summary.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-04 16:26:25 +01:00
Felix Matouschek 48734484f9 chore: Bump dependency on kubernetes.core
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>
2024-03-04 16:01:26 +01:00
Felix Matouschek d6efd6736e ci: Drop all green job
Drop the all green job which essentially duplicates functionality
provided by GitHub Actions already.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-04 15:02:44 +01:00
Felix Matouschek 62007c326a ci: Cleanup kubevirt_vm_info integration test
- Use uniform way of naming plays, tasks and VMs
- Use defaults where possible

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-04 14:02:08 +01:00
Felix Matouschek ed642885ab ci: Cleanup kubevirt_vm integration test
- 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>
2024-03-04 14:02:08 +01:00
Felix Matouschek b928cb5b29 ci: Cleanup inventory_kubevirt integration test
- 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>
2024-03-04 14:02:03 +01:00
Felix Matouschek 5e2f152c7d ci: Fix failing integration tests
The default name of the default user in centos.stream9 is cloud-user.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-01 16:01:51 +01:00
Felix Matouschek 9e2fc74ccb ci: Fix non failing integration tests
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>
2024-03-01 14:50:33 +01:00
Felix Matouschek 92aeaa7215 cleanup: Use default shell when deploying KubeVirt
The default shell (bash -e {0}) should suffice to deploy KubeVirt.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-29 17:13:42 +01:00
Felix Matouschek 6075886c4a fix: Fix release workflow failing because of non-zero exit
Fix the failing release workflow by adding a call to true after grepping
for the hopefully nonexistent release tag.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-29 17:13:03 +01:00
Felix Matouschek 9797021880 chore: Bump collection version to 1.2.0
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-29 16:44:07 +01:00
Felix Matouschek 2e561f6b04 ci: Run shellcheck in CI linter job
Install and run shellcheck in the CI linter job. Lint all files matching
'*.sh' in the tree.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-29 15:37:03 +01:00
Felix Matouschek 57e953d347 fix: Use correct KubeVirt project name
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-29 14:13:25 +01:00
Felix Matouschek 55fb9b94b5 chore: Bump docs copyright year
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-29 14:13:20 +01:00
Felix Matouschek 69f7699c08 chore: Remove unneeded sanity test ignore files
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-29 14:06:31 +01:00
Felix Matouschek 49638c31b5 chore: Run black formatter on project files
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-29 14:06:16 +01:00
Felix Matouschek 44e1c0a719 cleanup: Update requirements throughout the project
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>
2024-02-29 14:03:19 +01:00
Felix Matouschek e0cde14f30 cleanup: Remove __resource_field_to_dict workaround from inventory
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>
2024-02-29 13:56:33 +01:00
Felix Matouschek 65f7c27487 chore: Update README.md
Update README.md to include all modules of the collection and keep
module descriptions in sync.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-29 13:32:37 +01: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 44fce1cc31 fix: Ensure compatibility with KubeVirt >=1.1.0
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>
2024-02-29 11:21:17 +01:00
Felix Matouschek fa9183c21a hack: Bump e2e-setup.sh version
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>
2024-02-29 09:47:50 +01:00
Felix Matouschek f92c500de4 .github: Cleanup actions
Cleanup the .github actions:

- Use the same syntax and/or commands where possible
- Drop unnecessary parameters and steps / commands
- In the all-green job ensure that all CI jobs passed
- Update the naming of jobs
- Review permissions and grant write permission only where
  necessary (repo is set to read-only by default)
- Review installed dependencies (try to fix the failing docs job)
- Run yamllint and fix findings
- Replace deprecated set-output syntax

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-28 17:04:54 +01:00
Felix Matouschek b719edf5da .github: Update tested Ansible and Python versions
Use Python 3.9 - 3.12 and Ansible 2.14 - 2.16, devel and milestone to run
tests of the collection. Use the latest stable python version in test setups
where sensible. Instead of using the integration.yml workflog from main
use it from the same commit as the test runs instead.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-28 09:14:23 +01:00
Felix Matouschek 205ef04954 .github: Bump versions of all used actions
Bump the versions of all used actions to the latest stable version and
try to use the same config across files and defaults where sensible.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-27 16:40:33 +01:00
Felix Matouschek 74f4a48ac1 Pin python version
Pin the supported python version in tests/config.yaml and mention it in
README.md.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-26 17:04:19 +01:00
Felix Matouschek bb132b1682 Move test .kubeconfig into CI setup
Inline the creation of a test .kubeconfig into the CI setup.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-26 16:59:03 +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 MatouschekandGitHub f313d73864 Merge pull request #28 from 0xFelix/bump-1.1.0
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-09-21 10:48:45 +02:00
Felix Matouschek 6d209f5597 changelog.yaml: Fix indentation for linter
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-09-21 10:47:01 +02:00
Felix MatouschekandGitHub 1a824ed0be Merge pull request #27 from 0xFelix/bump-1.1.0
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-09-21 10:11:34 +02:00
Felix Matouschek b6e0acc6a8 Drop old changelog fragments
They were consumed in the 1.1.0 release.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-09-21 10:10:25 +02:00
Felix MatouschekandGitHub dcb3de0275 Merge pull request #26 from 0xFelix/bump-1.1.0
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-09-21 08:11:46 +02:00
Felix Matouschek 1f1adace47 Bump version to 1.1.0
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-09-21 08:10:19 +02: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
Felix Matouschek 6b360aa377 hack/e2e-setup.sh: Update versions
Update versions:
  - kubectl to v1.28.1
  - CDI to v1.57.0
  - common-instancetypes to v0.3.2
  - CNAO to v0.89.0

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-09-06 11:32:37 +02:00
Felix Matouschek e33b479326 inventory: Add create_groups option
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>
2023-09-05 15:56:46 +02:00
Felix Matouschek 100bcee082 inventory: Flatten created groups
Drop creation of the namespace_vmis_group as it is redundant.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-09-05 15:53:22 +02:00
Felix MatouschekandGitHub 20a3534f37 Merge pull request #21 from guidograzioli/ansible_galaxy_workaround
Merge this manually to overcome failing CI.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-08-22 16:55:56 +02:00
Felix MatouschekandGitHub 628955dd9d Merge pull request #20 from 0xFelix/drop-note
README.md: Drop note about supported collection for now

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-08-22 11:38:25 +02:00
Felix Matouschek 05045f64d0 README.md: Drop note about supported collection for now
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-08-22 10:32:33 +02:00
Felix Matouschek 2f60ad7c69 ci: Exclude py3.9 with Ansible milestone
Python 3.9 is no longer supported by the latest Ansible milestone
version.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-08-14 15:01:31 +02:00
Felix Matouschek 6dda795ad2 Bump version to 1.0.0
Bump version to 1.0.0 for the initial release.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-08-09 13:31:46 +02:00
Felix Matouschek ee91bdb005 Bump to 0.1.2
Bump to 0.1.2 for testing purposes

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-08-09 11:16:05 +02:00
Felix Matouschek c42749e9d1 fix: Use kubevirt-bot in release workflow
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-08-09 10:14:01 +02:00
Felix Matouschek 6c3aad2f82 release: Run other workflows explicitly
To bypass restrictions on GitHub Actions run the docs and ci workflows
manually after creating a release. GitHub Actions does not trigger
other workflows from a workflow run if not using a personal access
token (PAT). By calling the workflows explicitly, it is possible to
work around this restriction without the need for a PAT.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-08-09 10:10:54 +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 0875abc080 kubevirt_vm: Prevent unnecessary whitespace
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>
2023-07-18 16:08:01 +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 1e94c19ac4 e2e-setup: Add support for deploying CDI
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-07-18 11:37:08 +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 9bc8d20ea6 inventory: Provide dummy classes to satisfy Ansible sanity
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-07-17 15:01:36 +02:00
Felix Matouschek 68f5cc8e33 Update Ansible GitHub workflows
The workflows committed in the first commit were missing the
installation of required dependencies and other fixes.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-07-17 14:45:31 +02:00
Felix Matouschek e1499d4aae Use correct author syntax
This updates the author syntax to satisfy the linter.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-07-17 14:12:14 +02:00
Felix Matouschek 7c347174ab Change LICENSE to GPLv3
Ansible collections are required to be licensed under the GPLv3.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-07-17 14:09:18 +02:00
Felix MatouschekandGitHub 1241bbc53c Merge pull request #2 from 0xFelix/gh-templates
Add GitHub PR and Issue templates

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2023-07-17 11:10:07 +02:00
Felix Matouschek 95cea233c9 Add GitHub PR and Issue templates
Add the GitHub PR and Issue templates used by the KubeVirt org.

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