update docs

Signed-off-by: Guido Grazioli <ggraziol@redhat.com>
This commit is contained in:
Guido Grazioli
2023-08-07 14:06:33 +02:00
parent 9c90dfc105
commit 4ead9fabd2
4 changed files with 88 additions and 122 deletions

View File

@@ -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
```