This repository contains a collection of ansible playbooks that automate a variety of tasks related to PMM (Percona Monitoring and Management). The playbooks are designed to simplify routine tasks, making it easier to test a specific database configuration with PMM.
This playbook provisions a MySQL cluster with asynchronous replication. It sets up the necessary configurations and ensures that the cluster is ready for use.
This playbook provisions a MySQL cluster with group replication. It configures the cluster and ensures that all nodes are properly synchronized.
This playbook provisions a Valkey/Redis multi-source cluster with replication between the nodes. It sets up the cluster with redundancy to prevent data loss.
The following diagram help visualize the cluster network topology:
This playbook provisions a Valkey Sentinel cluster with replication. It configures the sentinel nodes to monitor Valkey source instances and handle failover automatically.
The following diagram help visualize the cluster network topology:

For the sake of simplicity, all playbooks are designed to run on a single host. However, they can be adapted for multi-host setups if needed. Therefore, the playbooks assume that all containers are running on the same host and within the same container network. The communication between the containers is handled through the Docker network, allowing them to interact seamlessly, using the container names as hostnames.
To run any of the playbooks, navigate to the corresponding directory and execute the playbook using the following command:
ansible-playbook <playbook>.ymlEnsure that you have the necessary directory permissions before running the playbook. Some playbooks may persist data in the user's home directory, so make sure the home directory is writable.
Docker images will be pulled automatically if they are not available locally. If you want to use a specific version of the Docker images, you can modify the playbook to specify the desired image tags.
To clean up the environment after running the playbooks, you can use the cleanup.sh script provided in each directory. This script will stop and remove all containers and volumes (if applicable) created by the playbook, ensuring that your environment is clean for the next run.
./cleanup.sh