Skip to content

Commit

Permalink
Merge pull request #10 from guidograzioli/prerel
Browse files Browse the repository at this point in the history
Prerelease
  • Loading branch information
kubevirt-bot authored Aug 7, 2023
2 parents cf33661 + 4ead9fa commit 36fd506
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 148 deletions.
31 changes: 0 additions & 31 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: 🐛 Bug report
about: Create a report to help us improve

---

##### SUMMARY
<!-- Explain the problem briefly -->


##### ISSUE TYPE
- Bug Report


##### ANSIBLE VERSION
<!-- Paste, BELOW THIS COMMENT, verbatim output from "ansible --version"-->
```
```

##### COLLECTION VERSION
<!-- Paste, BELOW THIS COMMENT, verbatim output from "ansible-galaxy collection list"-->
<!-- If using virtual environments or execution environments, remember to activate them-->
```
```

##### STEPS TO REPRODUCE
<!-- List the steps to reproduce the problem, using a minimal test-case. -->

<!-- Paste example playbook below -->
```yaml

```

##### EXPECTED RESULTS
<!-- What did you expect to happen when running the steps above? -->


##### ACTUAL RESULTS
<!-- What actually happened? If possible run with extra verbosity (-vvvv) and diff (--diff) -->
<!-- Please also include check mode (--check --diff) output if the API returns an error -->
<!-- Be sure to mask any sensitive information -->

<!--- Paste verbatim command output between quotes below -->
```
```
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: ✨ Feature request
about: Suggest an idea for this project

---

##### SUMMARY
<!--- Explain the problem briefly -->


##### ISSUE TYPE
- Feature Idea
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.KUBEVIRT_PAT }}

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
3 changes: 0 additions & 3 deletions MAINTAINING.md

This file was deleted.

159 changes: 65 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,141 +1,112 @@
# Lean Ansible bindings for KubeVirt
<!-- Add CI and code coverage badges here. Samples included below. -->
[![CI](https://github.com/kubevirt/kubevirt.core/workflows/CI/badge.svg?event=push)](https://github.com/kubevirt/kubevirt.core/actions)
<!--start build_status -->
[![Build Status](https://github.com/kubevirt/kubevirt.core/workflows/CI/badge.svg?event=push)](https://github.com/kubevirt/kubevirt.core/actions)

<!-- Describe the collection and why a user would want to use it. What does the collection do? -->
This repo hosts the kubevirt.core Ansible Collection.
> **_NOTE:_ If you are Red Hat customer, install `redhat.ocpv` from [Automation Hub](https://console.redhat.com/ansible/ansible-dashboard) as the certified version of this collection.**
<!--end build_status -->
The collection includes an inventory plugin for Ansible to automate the management of VMs running on KubeVirt.
This repository hosts the `kubevirt.core` Ansible Collection, which provides virtual machine operations and inventory source for use with Ansible.

## Code of Conduct

We follow the [Ansible Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html) in all our interactions within this project.

If you encounter abusive behavior, please refer to the [policy violations](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html#policy-violations) section of the Code for information on how to raise a complaint.

## Communication

<!--List available communication channels. In addition to channels specific to your collection, we also recommend to use the following ones.-->

We announce releases and important changes through Ansible's [The Bullhorn newsletter](https://github.com/ansible/community/wiki/News#the-bullhorn). Be sure you are [subscribed](https://eepurl.com/gZmiEP).

Join us in the `#ansible` (general use questions and support), `#ansible-community` (community and collection development questions), and other [IRC channels](https://docs.ansible.com/ansible/devel/community/communication.html#irc-channels).

We take part in the global quarterly [Ansible Contributor Summit](https://github.com/ansible/community/wiki/Contributor-Summit) virtually or in-person. Track [The Bullhorn newsletter](https://eepurl.com/gZmiEP) and join us.

For more information about communication, refer to the [Ansible Communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).

## Contributing to this collection
<!--start requires_ansible-->
## Ansible version compatibility

<!--Describe how the community can contribute to your collection. At a minimum, fill up and include the CONTRIBUTING.md file containing how and where users can create issues to report problems or request features for this collection. List contribution requirements, including preferred workflows and necessary testing, so you can benefit from community PRs. If you are following general Ansible contributor guidelines, you can link to - [Ansible Community Guide](https://docs.ansible.com/ansible/devel/community/index.html). List the current maintainers (contributors with write or higher access to the repository). The following can be included:-->
This collection has been tested against following Ansible versions: **>=2.9.10**.
<!--end requires_ansible-->

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 kind of contribution is very welcome.

You don't know how to start? Refer to our [contribution guide](CONTRIBUTING.md)!

We use the following guidelines:
## Included content

* [CONTRIBUTING.md](CONTRIBUTING.md)
* [REVIEW_CHECKLIST.md](REVIEW_CHECKLIST.md)
* [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html)
* [Ansible Development Guide](https://docs.ansible.com/ansible/devel/dev_guide/index.html)
* [Ansible Collection Development Guide](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections)
### Plugins

## Collection maintenance
* `kubevirt`: inventory source for kubevirt virtual machines
* `kubevirt_vm`: create or delete kubevirt virtual machines

The current maintainers are listed in the [MAINTAINERS](MAINTAINERS) file. If you have questions or need help, feel free to mention them in the proposals.
## Using this collection

To learn how to maintain / become a maintainer of this collection, refer to the [Maintainer guidelines](MAINTAINING.md).
<!--start galaxy_download -->
### Installing the Collection from Ansible Galaxy

## Governance
Before using this collection, you need to install it with the Ansible Galaxy command-line tool:
```bash
ansible-galaxy collection install kubevirt.core
```
<!--end galaxy_download -->

<!--Describe how the collection is governed. Here can be the following text:-->
### Build and install locally

The process of decision making in this collection is based on discussing and finding consensus among participants.
Clone the repository, checkout the tag you want to build, or pick the main branch for the development version; then:
```bash
ansible-galaxy collection build .
ansible-galaxy collection install kubevirt-kubevirt.core-*.tar.gz
```

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

## Tested with Ansible
#### Ansible collections

<!-- List the versions of Ansible the collection has been tested with. Must match what is in galaxy.yml. -->
* [kubernetes.core](https://docs.ansible.com/ansible/latest/collections/kubernetes/core/index.html)

## External requirements
You can also include it in a `requirements.yml` file and install it with `ansible-galaxy collection install -r requirements.yml`, using the format:
```yaml
---
collections:
- name: kubevirt.core
```
<!-- List any external resources the collection depends on, for example minimum versions of an OS, libraries, or utilities. Do not list other Ansible collections here. -->
- python >= 3.6
#### Python libraries
Python libraries:
- kubernetes
- PyYaml
- jsonpatch
- jinja2
### Supported connections
<!-- Optional. If your collection supports only specific connection types (such as HTTPAPI, netconf, or others), list them here. -->

## Included content
To install all the dependencies:
```bash
pip install -r requirements.txt
```

<!-- Galaxy will eventually list the module docs within the UI, but until that is ready, you may need to either describe your plugins etc here, or point to an external docsite to cover that information. -->
See [Ansible Using collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details.

## Using this collection
<!--start community_readme -->
## Code of Conduct

<!--Include some quick examples that cover the most common use cases for your collection content. It can include the following examples of installation and upgrade (change NAMESPACE.COLLECTION_NAME correspondingly):-->
We follow the [KubeVirt Code of Conduct](https://github.com/kubevirt/kubevirt/blob/main/CODE_OF_CONDUCT.md).

### Installing the Collection from Ansible Galaxy
## Contributing to this collection

Before using this collection, you need to install it with the Ansible Galaxy command-line tool:
```bash
ansible-galaxy collection install kubevirt.core
```
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.

You can also include it in a `requirements.yml` file and install it with `ansible-galaxy collection install -r requirements.yml`, using the format:
```yaml
---
collections:
- name: kubevirt.core
```
We are actively accepting new contributors.

Note that if you install the collection from Ansible Galaxy, it will not be upgraded automatically when you upgrade the `ansible` package. To upgrade the collection to the latest available version, run the following command:
```bash
ansible-galaxy collection install kubevirt.core --upgrade
```
Any kind of contribution is very welcome.

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 to install version `0.1.0`:
You don't know how to start? Refer to our [contribution guide](CONTRIBUTING.md)!

```bash
ansible-galaxy collection install kubevirt.core:==0.1.0
```
We use the following guidelines:

See [Ansible Using collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details.
* [CONTRIBUTING.md](CONTRIBUTING.md)
* [REVIEW_CHECKLIST.md](REVIEW_CHECKLIST.md)
* [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html)
* [Ansible Development Guide](https://docs.ansible.com/ansible/devel/dev_guide/index.html)
* [Ansible Collection Development Guide](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections)

## Release notes
## Collection maintenance

See the [changelog](https://github.com/ansible-collections/REPONAMEHERE/tree/main/CHANGELOG.rst).
The current maintainers are listed in the [OWNERS](OWNERS) file. If you have questions or need help, feel free to mention them in the proposals.

## Roadmap
To learn how to maintain / become a maintainer of this collection, refer to the [Maintainer guidelines](https://docs.ansible.com/ansible/devel/community/maintainers.html).

<!-- Optional. Include the roadmap for this collection, and the proposed release/versioning strategy so users can anticipate the upgrade/update cycle. -->
## Governance

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

<!-- List out where the user can find additional information, such as working group meeting times, slack/IRC channels, or documentation for the product this collection automates. At a minimum, link to: -->
Every voice is important. If you have something on your mind, create an issue or dedicated discussion and let's discuss it!
<!--end community_readme -->

- [Ansible Collection overview](https://github.com/ansible-collections/overview)
- [Ansible User guide](https://docs.ansible.com/ansible/devel/user_guide/index.html)
- [Ansible Developer guide](https://docs.ansible.com/ansible/devel/dev_guide/index.html)
- [Ansible Collections Checklist](https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst)
- [Ansible Community code of conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html)
- [The Bullhorn (the Ansible Contributor newsletter)](https://us19.campaign-archive.com/home/?u=56d874e027110e35dea0e03c1&id=d6635f5420)
- [News for Maintainers](https://github.com/ansible-collections/news-for-maintainers)
<!--start support -->
<!--end support -->

## Licensing

<!-- Include the appropriate license information here and a pointer to the full licensing details. If the collection contains modules migrated from the ansible/ansible repo, you must use the same license that existed in the ansible/ansible repo. See the GNU license example below. -->

GNU General Public License v3.0 or later.

See [LICENSE](./LICENSE) to see the full text.
2 changes: 1 addition & 1 deletion REVIEW_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Review Checklist

Refer to the [Collection review checklist](https://github.com/ansible/community-docs/blob/main/review_checklist.rst).
Refer to the [Collection review checklist](https://docs.ansible.com/ansible/devel/community/collection_contributors/collection_reviewing.html).
34 changes: 16 additions & 18 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,32 @@

## Continuous integration

The collection is tested with a [molecule](https://github.com/ansible-community/molecule) setup covering the included roles and verifying correct installation and idempotency.
In order to run the molecule tests locally with python 3.9 available, after cloning the repository:
The `hack/e2e-setup.sh` script contains the steps necessary to reproduce the CI test environment, which relies on `kubectl` and `kind`.

```
pip install yamllint 'molecule[docker]~=3.5.2' ansible-core flake8 ansible-lint voluptuous
molecule test --all
```

## Test playbooks
## Example config and playbooks

Sample playbooks are provided in the `playbooks/` directory; to run the playbooks locally (requires a rhel system with python 3.9+, ansible, and systemd) the steps are as follows:
Sample playbooks and inventory configurations are provided in the `examples/` directory; to run the playbooks locally, build the testing environment with the script above, then the steps are as follows:

```
```bash
# setup environment
pip install ansible-core
# clone the repository
git clone https://github.com/ansible-middleware/amq
cd amq
git clone https://github.com/kubevirt/kubevirt.core
cd kubevirt.core
# install collection dependencies
ansible-galaxy collection install -r requirements.yml
# install collection python deps
pip install -r requirements.txt
# create inventory for localhost
cat << EOF > inventory
[amq]
localhost ansible_connection=local
EOF
# run the playbook
ansible-playbook -i inventory playbooks/activemq.yml
# setup environment
hack/e2e-setup.sh
# run inventory source
ansible-inventory -i examples/inventory.kubevirt.yml
# create a virtual machine
ansible-playbook -i examples/inventory.kubevirt.yml examples/play-create-min.yml
# terminate a virtual machine
ansible-playbook -i examples/inventory.kubevirt.yml examples/play-delete.yml
# terminate the environment
hack/e2e-setup.sh --cleanup
```

0 comments on commit 36fd506

Please sign in to comment.