This project contains Ansible playbooks for deploying services and roles tested with Molecule.
To run an Ansible playbook, use the following command:
ansible-playbook playbooks/<playbook_name>.yml -i inventories/<inventory_file>Replace <playbook_name> with the name of the playbook (e.g., nginx.yml) and <inventory_file> with your inventory file.
Molecule is used to test Ansible roles.
- Python 3.x
- pip
- Ansible
- Molecule (install via
pip install molecule)
To run Molecule tests for a role:
cd roles/<role_name>
molecule testThis will create instances, converge the role, verify, and destroy the instances.
molecule create: Create test instances.molecule converge: Apply the role to instances.molecule verify: Run verification tests.molecule destroy: Destroy test instances.