Skip to content

Latest commit

 

History

History
 
 

testing-molecule-kind

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Testing with Molecule, Kind, and Ansible

This directory contains a Molecule-based test environment which allows development and testing of Ansible playbooks against a Kind Kubernetes cluster.

Installing Prerequisites

Before running the environment, you need to make sure Molecule, Kind, and Docker are installed:

  1. brew install kind docker (assuming macOS)
  2. pip3 install molecule ansible-test yamllint

Running tests

You can run the full default test scenario using Molecule:

molecule test

This scenario does the following:

  1. Builds a test Kind cluster.
  2. Runs the molecule/default/converge.yml playbook against the cluster.
  3. Runs the playbook again to test idempotence.
  4. 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