Giter VIP home page Giter VIP logo

community.kubevirt's Introduction

KubeVirt Collection for Ansible

THIS COLLECTION IS UNMAINTAINED AND DOES NOT WORK CORRECTLY WITH THE LATEST VERSIONS OF ANSIBLE!. Take a look if a replacing collection kubevirt.core provides functionality you need. If you're interested in fixing and maintaining community.kubevirt, please respond in the issue but we highly recommend you to consider contributing to kubevirt.core instead.

CI Codecov

This repo hosts the community.kubevirt Ansible Collection which is a part of the Ansible package.

The collection includes a variety of Ansible content to automate the management of KubeVirt container native virtualization environments.

Code of Conduct

We follow the Ansible Code of Conduct in all our interactions within this project.

If you encounter abusive behavior violating the Ansible Code of Conduct, please refer to the policy violations section of the Code of Conduct for information on how to raise a complaint.

Contributing to this collection

The content of this collection is made by people like you, a community of individuals collaborating on making the world better through developing automation software.

We are actively accepting new contributors.

Any kinds of contributions are very welcome.

You don't know how to start? Refer to our Contribution guide!

To learn more about ways of how you can contribe to Ansible and what you can achieve, refer to the Contributing to the Project guidelines and the Contributor Path.

Collection maintenance

The current maintainers (contributors with writeor higher access) are listed in the MAINTAINERS file. If you have questions or need help, feel free to mention them in the proposals.

To learn how to maintain / become a maintainer of this collection, refer to the Maintainer guidelines.

It is necessary for maintainers of this collection to be subscribed to:

  • The collection itself (the Watch button -> All Activity in the upper right corner of the repository's homepage).
  • The "Changes Impacting Collection Contributors and Maintainers" issue.

They also should be subscribed to Ansible's The Bullhorn newsletter.

Releasing the collection

We release the collection using the Collection releasing guidelines.

The collection follows the Semantic Versioning.

See the changelog.

Communication

We announce releases and important changes through Ansible's The Bullhorn newsletter. Be sure you are subscribed.

Join us in the #ansible (general use questions and support), #ansible-community (community and collection development questions), and other IRC channels on Libera.Chat.

We take part in the global quarterly Ansible Contributor Summit virtually or in-person. Track The Bullhorn newsletter and join us.

For more information about communication, refer to the Ansible Communication guide.

Governance

The process of decision making in this collection is based on discussing and finding consensus among participants.

Every voice is important and every idea is valuable. If you have something on your mind, create an issue or dedicated discussion and let's discuss it!

External requirements

  • python >= 2.7
  • openshift >= 0.8.2

Included Content

Modules:

  • kubevirt_cdi_upload: Upload local VM images to CDI Upload Proxy.
  • kubevirt_preset: Manage KubeVirt virtual machine presets.
  • kubevirt_pvc: Manage PVCs on Kubernetes.
  • kubevirt_rs: Manage KubeVirt virtual machine replica sets.
  • kubevirt_template: Manage KubeVirt templates.
  • kubevirt_vm: Manage KubeVirt virtual machine.

Plugins:

  • kubevirt: KubeVirt inventory source.

Using this collection

Checking the Collection version

To check if the collection is installed on your system and its current version, run the following command:

ansible-galaxy collection list community.kubevirt

Installing the Collection from Ansible Galaxy

Before using the kubevirt collection, you need to install it with the Ansible Galaxy CLI:

ansible-galaxy collection install community.kubevirt

You can also include it in a requirements.yml file and install it via ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
  - name: community.kubevirt

Note that if you install the collection from Ansible Galaxy, it will not be upgraded automatically if you upgrade the Ansible package. To upgrade the collection to the latest available version, run the following command:

ansible-galaxy collection install community.kubevirt --upgrade

You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax:

ansible-galaxy collection install community.kubevirt:==1.0.0

See Ansible Using collections for more details.

Installing the Collection with the Ansible package

Because the collection is shipped with Ansible, if you install the ansible package, the collection will be installed authomatically.

If you install the ansible-core package, you will need to intall the collection manually. Refer to the paragraph above.

More information

For more information about Ansible's Kubernetes integration, join the #ansible-kubernetes IRC channel on irc.libera.chat, and browse the resources in the Kubernetes Working Group Community wiki page.

Licensing

GNU General Public License v3.0 or later.

See LICENSE to see the full text.

community.kubevirt's People

Contributors

0xfelix avatar andersson007 avatar dericcrago avatar dmsimard avatar gundalow avatar snecklifter avatar tadeboro avatar tima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

community.kubevirt's Issues

Vote in community-topics on removing community.kubevirt from Ansible 6

SUMMARY

Since community.kubevirt requires community.kubernetes < 2.0.0, community.kubevirt has been broken in Ansible since Ansible 5.0.0. Attempts to fix this started more than half a year ago (#25, #34), but never finished. For that reason we started a vote to remove community.kubevirt from Ansible 6.0.0: ansible-community/community-topics#92

This issue is for information. Also if the vote is accepted, community.kubevirt can be re-added to Ansible 6 during the Ansible 6 major release cycle if it is fixed to work with the kubernetes.core version included in Ansible 6 at that time, and a new version including that fix is released.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

collection

Ansible Contributor Summit. Tuesday, April 12, 2022.

Ansible Contributor Summit

We are happy to announce that the registration for the Ansible Contributor Summit is open!

Why
  • This is a great opportunity for interested people to meet, discuss related topics, share their stories and opinions, get the latest important updates and just to hang out together.

  • There will be different announcements & presentations by Community, Core, Cloud, Network, and other teams.

  • Current contributors will be happy to share their stories and experience with newcomers.

  • There will be links to interactive self-passed instruqt scenarios shared during the event that help newcomers learn different aspects of development.

Where/when

Online on Matrix and Youtube. Tuesday, April 12, 2022, 12:00 - 20:00 UTC.

How to join
  • Add the event to your calendar. Use the ical URL (for example, in Google Calendar "Add other calendars" > "Import from URL") instead of importing the .ics file so that any updates to the event will be reflected in your calendar.

  • Check out the Summit page:

    • Add you name to attendees.
    • Suggest summit topics that would be interesting to you to hear about.
    • Vote on and propose changes to topics suggested by others.
    • If you want to be a presenter, please contact the Ansible Community team via [email protected].

We are looking forward to seeing you!:)

Hard coded api version at kubevirt_cdi_upload

SUMMARY

API version of upload.cdi.kubevirt.io is hard coded to v1alpha1 at kubevirt_cdi_upload.py meanwhile it's beta:

$ kubectl api-resources  --api-group upload.cdi.kubevirt.io
NAME                  SHORTNAMES   APIVERSION                       NAMESPACED   KIND
uploadtokenrequests   utr,utrs     upload.cdi.kubevirt.io/v1beta1   true         UploadTokenRequest
ISSUE TYPE
  • Feature Idea
COMPONENT NAME

kubevirt_cdi_upload

ADDITIONAL INFORMATION

It should be Auto-negotiate against the API or an argument.

KubeVirt module error "Could not find imported module support code"

Summary

What happened:
Installed Ansible on Mac for the user using pip method.

Built a KubeVirt playbook and ran it with ansible-playbook deployvm.yaml and get the following error:

fatal: [localhost]: FAILED! => {"msg": "Could not find imported module support code for ansible_collections.community.kubevirt.plugins.modules.kubevirt_vm. Looked for (['ansible_collections.community.kubernetes.plugins.module_utils.common.AUTH_ARG_SPEC', 'ansible_collections.community.kubernetes.plugins.module_utils.common'])"}

What you expected to happen:

Dependencies are find

How to reproduce it (as minimally and precisely as possible):
OS X 12.3

pip
python -m pip install --user ansible
ansible-playbook server2022.yaml

The playbook looks like:

Environment:

KubeVirt version (use virtctl version): 0.50.0
Kubernetes version (use kubectl version): 1.23.2
VM or VMI specifications:
Cloud provider or hardware configuration: Rancher K8S cluster
OS (e.g. from /etc/os-release): OS x
Kernel (e.g. uname -a): Darwin MaxBookPro.local 21.4.0 Darwin Kernel Version 21.4.0: Tue Jan 18 13:02:01 PST 2022; root:xnu-8020.100.406.0.1~18/RELEASE_X86_64 x86_64

Issue Type

Bug Report

Component Name

kubevirt

Ansible Version

$ ansible --version
ansible [core 2.12.2]
  config file = None
  configured module search path = ['/Users/mdiorio/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/mdiorio/Library/Python/3.9/lib/python/site-packages/ansible
  ansible collection location = /Users/mdiorio/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/mdiorio/Library/Python/3.9/bin/ansible
  python version = 3.9.10 (main, Jan 15 2022, 11:48:04) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.3
  libyaml = True

Configuration

$ ansible-config dump --only-changed

Empty

OS / Environment

Running on Mac OS X 12.3 targeting a Kubernetes Cluster

Steps to Reproduce


name: Create Windows 2022 VM
hosts: localhost
connection: local
tasks:
name: Create Windows 2022 VirtVM
kubevirt_vm:
namespace: default
name: win2022
state: running
cpu_cores: 2
memory: 4Gi
disks:

  • name: containerdisk
    volume:
    containerDisk:
    image: mcr.microsoft.com/windows/server:ltsc2022
    disk:
    bus: virtio

Expected Results

Even if my playbook may not work - I don't expect an error about not finding related components.

Actual Results

ansible-playbook [core 2.12.2]
  config file = None
  configured module search path = ['/Users/mdiorio/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/mdiorio/Library/Python/3.9/lib/python/site-packages/ansible
  ansible collection location = /Users/mdiorio/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/mdiorio/Library/Python/3.9/bin/ansible-playbook
  python version = 3.9.10 (main, Jan 15 2022, 11:48:04) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.3
  libyaml = True
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
redirecting (type: modules) ansible.builtin.kubevirt_vm to community.kubevirt.kubevirt_vm
Loading collection community.kubevirt from /Users/mdiorio/.ansible/collections/ansible_collections/community/kubevirt
Loading callback plugin default of type stdout, v2.0 from /Users/mdiorio/Library/Python/3.9/lib/python/site-packages/ansible/plugins/callback/default.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: server2022.yaml **************************************************************************************************************************************
Positional arguments: server2022.yaml
verbosity: 4
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
forks: 5
1 plays in server2022.yaml

PLAY [Create Windows 2022 VM] **********************************************************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************************************************
task path: /Users/mdiorio/ansible/kubevirt/server2022.yaml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: mdiorio
<127.0.0.1> EXEC /bin/sh -c 'echo ~mdiorio && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /Users/mdiorio/.ansible/tmp `"&& mkdir "` echo /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560845.436065-75963-18147611961876 `" && echo ansible-tmp-1645560845.436065-75963-18147611961876="` echo /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560845.436065-75963-18147611961876 `" ) && sleep 0'
Using module file /Users/mdiorio/Library/Python/3.9/lib/python/site-packages/ansible/modules/setup.py
<127.0.0.1> PUT /Users/mdiorio/.ansible/tmp/ansible-local-75959rq5rv3uu/tmppswjjh_a TO /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560845.436065-75963-18147611961876/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560845.436065-75963-18147611961876/ /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560845.436065-75963-18147611961876/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/local/opt/[email protected]/bin/python3.9 /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560845.436065-75963-18147611961876/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560845.436065-75963-18147611961876/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [Create Windows 2022 VirtVM] ******************************************************************************************************************************
task path: /Users/mdiorio/ansible/kubevirt/server2022.yaml:6
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: mdiorio
<127.0.0.1> EXEC /bin/sh -c 'echo ~mdiorio && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /Users/mdiorio/.ansible/tmp `"&& mkdir "` echo /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560851.607106-76001-148064369010803 `" && echo ansible-tmp-1645560851.607106-76001-148064369010803="` echo /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560851.607106-76001-148064369010803 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.kubevirt_vm to community.kubevirt.kubevirt_vm
Loading collection community.kubernetes from /Users/mdiorio/.ansible/collections/ansible_collections/community/kubernetes
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /Users/mdiorio/.ansible/tmp/ansible-tmp-1645560851.607106-76001-148064369010803/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "msg": "Could not find imported module support code for ansible_collections.community.kubevirt.plugins.modules.kubevirt_vm.  Looked for (['ansible_collections.community.kubernetes.plugins.module_utils.common.AUTH_ARG_SPEC', 'ansible_collections.community.kubernetes.plugins.module_utils.common'])"
}

PLAY RECAP *****************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Release plan

SUMMARY

(partially copied from ansible-collections/community.crypto#74 , thanks to @felixfontein)

We announce the releases of the community.kubevirt collection here.

We should decide eventually on how to release this collection (w.r.t. versioning).
Small collections like this one don't need a complex plan like the one for community.general and community.network.
So how about the following?

  1. Release minor and patch releases whenever we want (like after adding new features or fixing bugs). Since this collection is small, there's no need to fix things in advance. Just add features, and after a feature either wait a bit longer for more features/bugs, or make a release.

I suggest releasing without branching https://github.com/ansible/community-docs/blob/main/releasing_collections_without_release_branches.rst

Once we release a 2.0.0 (with some breaking change relative to 1.x.y), we can have a stable-1 branch so we can backport bugfixes (or even features) if needed, and release more 1.x.y versions.

CI is failing

SUMMARY

I wanted to report that CI probably fails becaues of a new ruamel.yaml.clib version (my (current) fix for community.general's stable-1: ansible-collections/community.general#2892), but it looks like CI is pretty much broken in this collection for other reasons (probably the community.kubernetes 2.0.0 release).

ISSUE TYPE
  • Bug Report
COMPONENT NAME

collection

kubevirt_vm: storageClassName seems to be ignored

SUMMARY

The attribute "storageClassName" seems to be ignored by kubevirt_vm

ISSUE TYPE
  • Bug Report
COMPONENT NAME

kubevirt_vm

ANSIBLE VERSION
ansible 2.9.14
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/dominik/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.9 (default, Aug 19 2020, 17:05:11) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]

CONFIGURATION

empty by intention

OS / ENVIRONMENT

Fedora release 31 (Thirty One)

STEPS TO REPRODUCE
[dominik@t460p ~]$ ansible-playbook -v "gdrive/CNV-Ceph HC/yml/02_vm1.yml"
Using /etc/ansible/ansible.cfg as config file
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match
'all'

PLAY [Playbook 2] *********************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************
ok: [localhost]

TASK [fedora11] ***********************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Timeout occurred while waiting for virtual machine to achieve 'running' state. Maybe try a higher wait_timeout value?"}

PLAY RECAP ****************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   


[dominik@t460p ~]$ cat "gdrive/CNV-Ceph HC/yml/02_vm1.yml"
---
# ansible-galaxy collection install community.general
# sudo dnf install python3-kubernetes python3-openshift
# https://github.com/kubevirt/ansible-kubevirt-modules/blob/master/examples/blog/part1/02_vm1.yaml
# https://docs.ansible.com/ansible/latest/collections/community/general/kubevirt_vm_module.html
- name: Playbook 2
  hosts: localhost
  connection: local
  tasks:
    - name: fedora11
      kubevirt_vm:
          state: running
          wait: true
          name: fedora11
          namespace: default
          memory: 1024M
          datavolumes:
            - name: rootdisk-dv
              source:
                http:
                  url: >-
                    http://ftp-stud.hs-esslingen.de/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2
              pvc:
                # is this ignored?
                storageClassName: ocs-storagecluster-ceph-rbd
                accessModes:
                  - ReadWriteOnce
                storage: 5Gi
          disks:
            - name: rootdisk
              volume:
                dataVolume:
                  name: rootdisk-dv


[dominik@t460p ~]$ ansible --version
ansible 2.9.14
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/dominik/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.9 (default, Aug 19 2020, 17:05:11) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
[dominik@t460p ~]$ ansible-config dump --only-changed
[dominik@t460p ~]$ cat /etc/redhat-release 
Fedora release 31 (Thirty One)
EXPECTED RESULTS
spec:
  dataVolumeTemplates:
  - apiVersion: cdi.kubevirt.io/v1alpha1
    kind: DataVolume
...
    spec:
      pvc:
...
        storageClassName: ocs-storagecluster-ceph-rbd
...
ACTUAL RESULTS
[dominik@t460p ~]$ tmp/oc get vm/fedora11 -o  yaml
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
  annotations:
    kubevirt.io/latest-observed-api-version: v1alpha3
    kubevirt.io/storage-observed-api-version: v1alpha3
  creationTimestamp: "2020-12-07T19:45:03Z"
  generation: 1
  managedFields:
  - apiVersion: kubevirt.io/v1alpha3
    fieldsType: FieldsV1
    fieldsV1:
      f:spec:
        .: {}
        f:dataVolumeTemplates: {}
        f:running: {}
        f:template:
          .: {}
          f:metadata:
            .: {}
            f:labels:
              .: {}
              f:vm.cnv.io/name: {}
          f:spec:
            .: {}
            f:domain:
              .: {}
              f:devices:
                .: {}
                f:disks: {}
              f:resources:
                .: {}
                f:requests:
                  .: {}
                  f:memory: {}
            f:volumes: {}
    manager: OpenAPI-Generator
    operation: Update
    time: "2020-12-07T19:45:03Z"
  - apiVersion: kubevirt.io/v1alpha3
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .: {}
          f:kubevirt.io/latest-observed-api-version: {}
          f:kubevirt.io/storage-observed-api-version: {}
      f:status: {}
    manager: virt-controller
    operation: Update
    time: "2020-12-07T19:45:03Z"
  name: fedora11
  namespace: default
  resourceVersion: "3470747"
  selfLink: /apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/fedora11
  uid: 9d02eab9-0d36-4d7b-bdf5-1da08d1abeae
spec:
  dataVolumeTemplates:
  - metadata:
      creationTimestamp: null
      name: rootdisk-dv
    spec:
      pvc:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi
      source:
        http:
          url: http://ftp-stud.hs-esslingen.de/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2
  running: true
  template:
    metadata:
      creationTimestamp: null
      labels:
        vm.cnv.io/name: fedora11
    spec:
      domain:
        devices:
          disks:
          - name: rootdisk
          - disk:
              bus: virtio
            name: rootdisk-dv
        machine:
          type: pc-q35-rhel8.2.0
        resources:
          requests:
            memory: 1024M
      volumes:
      - dataVolume:
          name: rootdisk-dv
        name: rootdisk
      - dataVolume:
          name: rootdisk-dv
        name: rootdisk-dv

Making the collection working with community.kubernetes 2.0.0

SUMMARY

Relates to #25.

The collection has a dependency - the community.kubernetes collection.
There were breaking changes introduced in community.kubernetes 2.0.0 and community.kubevirt cannot work with it.

Currently the community.kubernetes versions are restricted in galaxy.yml:

dependencies:
  community.kubernetes: '>=1.0.0,<2.0.0'
  1. The issue is to make the collection working with community.kubernetes 2.0.0+

This will be a breaking change also, so will require the next major version and prior announcement some time before the release.

OR
2) Evaluate if the dependency is really needed? Maybe it's sensible to get rid of it? (I don't use the collections, so hard to say)

ISSUE TYPE
  • Bug Report

Bootstrap community.kubevirt setup

These modules were in community.general, we've span them out into their own collection/.

Context ansible/community#539 (comment)

Tracking: ansible-collections/overview#128 (comment)

PR: #4

Branch bootstrap-collection

Removal from c.g

  • tests/unit/requirements.txt openshift ; python_version >= '2.7'

PRs should have integration tests with a kubevirt instance

The modules are not integration tested against a kubevirt instance whenever there is a new PR.
We run ansible-tests and other things but we currently lack integration test coverage.

Zuul has an implementation of minikube: https://opendev.org/zuul/zuul-jobs/src/branch/master/roles/ensure-kubernetes/tasks/minikube.yaml, maybe kubevirt is not too far off: https://kubevirt.io/quickstart_minikube/

Integration tests would look like those from Ansible: https://github.com/ansible/ansible/tree/devel/test/integration/targets -- regular Ansible tasks that exercise the modules and validate their expected behavior.

Can't get constructed to work with this plugin

Dynamic inventory lists have sporadic documentation so I might be doing something wrong. Given a simple inventory, I think this should construct new groups:
00_kubevirt.yaml

plugin: community.kubevirt.kubevirt
connections:
  - namespaces:
      - ipsecgw

constructed.yaml

plugin: constructed
conditional_groups:
  ipsecgw: "'vm' in object_type"

in folder inventory

root@86c5070aec4d:/# ansible-inventory -i inventory --graph
[DEPRECATION WARNING]: COMMAND_WARNINGS option, the command warnings feature is being removed. This feature will be 
removed from ansible-core in version 2.14. Deprecation warnings can be disabled by setting deprecation_warnings=False in 
ansible.cfg.
[WARNING]: Unable to parse /inventory/constructed.yaml as an inventory source
@all:
  |--@label_app_kubernetes_io_instance_virtual_machines:
  |  |--ipsecgw-ipsecgw01-08519f86-efd5-4165-aa77-7d604436f148
  |--@label_app_kubernetes_io_name_dp_lab_ryan:
  |  |--ipsecgw-ipsecgw01-08519f86-efd5-4165-aa77-7d604436f148
  |--@label_app_io_ansible_group_ipsecgw:
  |  |--ipsecgw-ipsecgw01-08519f86-efd5-4165-aa77-7d604436f148
  |--@label_app_io_name_ipsecgw:
  |  |--ipsecgw-ipsecgw01-08519f86-efd5-4165-aa77-7d604436f148
  |--@label_kubevirt_io_domain_ipsecgw01:
  |  |--ipsecgw-ipsecgw01-08519f86-efd5-4165-aa77-7d604436f148
  |--@label_kubevirt_io_nodeName_knode02:
  |  |--ipsecgw-ipsecgw01-08519f86-efd5-4165-aa77-7d604436f148
  |--@label_io_vm_true:
  |  |--ipsecgw-ipsecgw01-08519f86-efd5-4165-aa77-7d604436f148
  |--@rancher_prime_iad0_com_k8s_clusters_c_vqfrr:
  |  |--@namespace_ipsecgw:
  |  |  |--@namespace_ipsecgw_vms:
  |  |  |  |--ipsecgw-ipsecgw01-08519f86-efd5-4165-aa77-7d604436f148
  |--@ungrouped:

I can't debug this. I don't know the order of operations or why constructed seems to do nothing. It's supposed to be a builtin anyway. Besides enabling the plugin I didn't think I even had to explicitly call it in the inventory

Important information for collection maintainers

SUMMARY

Dear maintainers,

This is important for your collections!

  • In accordance with the Community decision, we have created the news-for-maintainers repository for announcements of changes impacting collection maintainers (see the examples) instead of Issue 45 that will be closed soon.

    • To keep yourself well-informed and, therefore, things in your collection working, please subscribe to the repository by using the Watch button in the upper right corner on the repository's home page.
    • If you do not want to get notifications about related discussions, please subscribe only to Issues.
    • Please read the brief guidelines on how the repository should be used.
    • Please avoid unnecessary discussions in issues, use the Discussions feature. Every comment posted will notify a lot of folks!
  • Also we would like to remind you about the Bullhorn contributor newsletter which has recently started to be released weekly. To learn what it looks like, see the past releases. Please subscribe and talk to the Community via Bullhorn!

  • Join us in #ansible-social (for news reporting & chat), #ansible-community (for discussing collection & maintainer topics), and other channels on Matrix/IRC.

  • Help the Community and the Steering Committee to make right decisions by taking part in discussing and voting on the Community Topics that impact the whole project and the collections in particular. Your opinion there will be much appreciated!

Thank you!

kubevirt_pvc module seems to be broken

From @Akasurde on Apr 16, 2020 13:40

From @sbulage on Apr 16, 2020 13:36

SUMMARY

PVC is being created on the cluster, as I can see state is present in the playbook logs.

ISSUE TYPE
  • Bug Report

PVC created successfully but showing Timeout for error and overall playbook execution failed.

COMPONENT NAME

kubevirt_pvc

ANSIBLE VERSION
ansible-playbook 2.10.0.dev0
CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE
https://github.com/sbulage/ansible-kubevirt-modules/blob/master/tests/playbooks/kubevirt_pvc.yml
EXPECTED RESULTS

It should be show Timeout Error, even if PVC gets created successfully.

ACTUAL RESULTS
CreatePVCFailed: PVC creation timed out
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "access_modes": [
                "ReadWriteOnce"
            ],
            "annotations": {
                "kubevirt.io/provisionOnNode": "sbulage-ocp3-twvhg-worker-dz75z"
            },
            "api_key": null,
            "ca_cert": null,
            "cdi_source": null,
            "client_cert": null,
            "client_key": null,
            "context": null,
            "force": false,
            "host": null,
            "kubeconfig": null,
            "labels": null,
            "merge_type": null,
            "name": "pvc1",
            "namespace": "default",
            "password": null,
            "persist_config": null,
            "proxy": null,
            "resource_definition": null,
            "selector": null,
            "size": "100Mi",
            "state": "present",
            "storage_class_name": "hostpath-provisioner",
            "username": null,
            "validate_certs": null,
            "volume_mode": "Filesystem",
            "volume_name": null,
            "wait": true,
            "wait_timeout": 600
        }
    },
    "msg": "PVC creation timed out"
}
 
PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0  

Copied from original issue: ansible/ansible#68978

Copied from original issue: ansible/ansible#193

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.