This repository contains the code to manage and install infrastructure and software for a PerconaDB Galera Cluster
- Clone the repository
- Run
./bin/launch.shwith the appropriate argument listed below
launch.sh allows you to carry out various tasks to help with development and deployment of services. The following arguments are available:
| Argument | Action | Additional Arguments |
|---|---|---|
| NONE | Check for the existence of the Python virtualenv, create it if it does not exist | |
| tfinit | Intialise the Terraform providers and modules | |
| tfplan | Run a Terraform Plan | |
| tfinit | Apply the terraform code | |
| tfdestroy | Destroy the infrastructure | |
| ansinit | Initialise the Ansible roles | |
| ansapply | Install the cluster using Ansible |
If you wish to contribute to the code, carry out the following steps:
- Make sure that
virtualenvis installed on the machine you are working on - Clone the repository
- Create a feature or bug branch (
git checkout -b feature/the_name_of_the_featureorgit checkout -b bug/the_name_of_the_bug) - Write the tests to meet your problem, run the tests and make sure they are failing
- Write the code to fix the tests
- Re-run the tests and make sure they succeed
- Push the changes up to GitHub
- Submit a Pull Request and ask for a code review
We use the following test frameworks to ensure that the code meets our quality standards.
| Tool | Description |
|---|---|
| ansible-lint | Ensures that Ansible code is formatted correctly and is syntactically valid |
| Test Kitchen | Executes the Ansible code against temporary instances and then runs the test suite |
| https://www.inspec.io | Allows us to write policies and then test our code against them to ensure they are compliant |
In order to run the tests, you can run one of the following commands:
- To test an Ansible role, run
./bin/launch.sh test-ansible <role_name> - To test the Terraform Infrastructure, run
./bin/launch.sh test-terraform
In both cases, you will need to have your AWS Credentials available in the local environment
All content in this repository is copyright 2019 Mockingbird Consulting Ltd - The Rural IoT Consultants. For more information on how we can help you make better decisions, visit our website.