This directory contains a Molecule-based test environment which allows development and testing of Ansible playbooks against a Kind Kubernetes cluster.
Before running the environment, you need to make sure Molecule, Kind, and Docker are installed:
brew install kind docker
(assuming macOS)pip3 install molecule ansible-test yamllint
You can run the full default test scenario using Molecule:
molecule test
This scenario does the following:
- Builds a test Kind cluster.
- Runs the
molecule/default/converge.yml
playbook against the cluster. - Runs the playbook again to test idempotence.
- Destroys the test Kind cluster.
You can also build the cluster and leave it running with:
molecule converge
After you're finished, tear down the development cluster with:
molecule destroy