diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 130e690..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,31 +0,0 @@ - - -**Is this a BUG REPORT or FEATURE REQUEST?**: - -> Uncomment only one, leave it on its own line: -> -> /kind bug -> /kind enhancement - - -**What happened**: - -**What you expected to happen**: - -**How to reproduce it (as minimally and precisely as possible)**: - - -**Anything else we need to know?**: - -**Environment**: -- KubeVirt version (use `virtctl version`): -- Kubernetes version (use `kubectl version`): -- common-templates version: -- VM or VMI specifications: -- Cloud provider or hardware configuration: -- OS (e.g. from /etc/os-release): -- Kernel (e.g. `uname -a`): -- Install tools: -- Others: diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..6a3e595 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,48 @@ +--- +name: 🐛 Bug report +about: Create a report to help us improve + +--- + +##### SUMMARY + + + +##### ISSUE TYPE + - Bug Report + + +##### ANSIBLE VERSION + +``` + +``` + +##### COLLECTION VERSION + + +``` + +``` + +##### STEPS TO REPRODUCE + + + +```yaml + +``` + +##### EXPECTED RESULTS + + + +##### ACTUAL RESULTS + + + + + +``` + +``` \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..b8ec680 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,12 @@ +--- +name: ✨ Feature request +about: Suggest an idea for this project + +--- + +##### SUMMARY + + + +##### ISSUE TYPE + - Feature Idea diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c880168..67c385b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/MAINTAINING.md b/MAINTAINING.md deleted file mode 100644 index 9fad0d3..0000000 --- a/MAINTAINING.md +++ /dev/null @@ -1,3 +0,0 @@ -# Maintaining this collection - -Refer to the [Maintainer guidelines](https://github.com/ansible/community-docs/blob/main/maintaining.rst). diff --git a/README.md b/README.md index c27b264..c5a07dd 100644 --- a/README.md +++ b/README.md @@ -1,141 +1,112 @@ # Lean Ansible bindings for KubeVirt - -[![CI](https://github.com/kubevirt/kubevirt.core/workflows/CI/badge.svg?event=push)](https://github.com/kubevirt/kubevirt.core/actions) + +[![Build Status](https://github.com/kubevirt/kubevirt.core/workflows/CI/badge.svg?event=push)](https://github.com/kubevirt/kubevirt.core/actions) - -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.** + -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 - - - -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 + +## Ansible version compatibility - +This collection has been tested against following Ansible versions: **>=2.9.10**. + -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). + +### 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 +``` + - +### 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 - +* [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 +``` - -- python >= 3.6 +#### Python libraries -Python libraries: - kubernetes - PyYaml - jsonpatch - jinja2 -### Supported connections - - -## Included content +To install all the dependencies: +```bash +pip install -r requirements.txt +``` - +See [Ansible Using collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details. -## Using this collection + +## Code of Conduct - +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). - +## Governance -## More information +The process of decision making in this collection is based on discussing and finding consensus among participants. - +Every voice is important. If you have something on your mind, create an issue or dedicated discussion and let's discuss it! + -- [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) + + ## Licensing - - GNU General Public License v3.0 or later. See [LICENSE](./LICENSE) to see the full text. diff --git a/REVIEW_CHECKLIST.md b/REVIEW_CHECKLIST.md index 9dccf7e..a056a90 100644 --- a/REVIEW_CHECKLIST.md +++ b/REVIEW_CHECKLIST.md @@ -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). diff --git a/docs/testing.md b/docs/testing.md index f9343f2..6ed0b3d 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -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 ```