This repository contains necessary Ansible playbooks, templates and files for automatic deployment of one of the following scenarios:
Caution: The current version is updated to work on Debian Stretch. The previous version works on Debian Jessie.
settings.yml : This file contains a bunch of variables that you can change to customize things like Kamailio's DBURL, Cluster's Virtual IP Address and so on.
kamailio.yml: This file contains a few plays to compile and install Kamailio.
ha-tools.yml: This file contains a play which installs Pacemaker and Corosync.
configure-ha.yml: This file contains a play that configures necessary resources for Pacemaker.
mysql.yml: This file contains a play that you can use to install and configure MySQL server.
rtpproxy.yml: This file contains two plays for installing and configuring a cluster of RTPProxy servers.
Docker-related files: You can use these files to setup a test environment for Ansible playbooks.
AnsibleMachine.df: Dockerfile to create a container with the latest version of Ansible installed. You can use this machine to run Ansible playbooks.
TargetMachine.df: Dockerfile to create a container with Debian Stretch and an SSH server. This Dockerfile can be used to create target machines (machines that Ansible will deploy software on them).
docker-compose.yml: This file uses AnsibleMachine.df and TargetMachine.df Dockerfiles to set-up a test environment for Ansible playbooks.
You can use docker-compose to setup a multi-container environment with a bridged network in order to test the playbooks. The docker-compose.yml with Dockerfiles can also help you in setting up your real operational environment. In order to run Ansible playbooks follow these steps:
Install Docker and docker-compose:
Change your current directory to the directory of the project and run the following command:
# docker-compose up -d
Use the following command to run a specific Ansible playbook:
# docker exec ansible-machine ansible-playbook -i hosts <playbook.yml>
If you do not want to use Docker, you should generally have two types of machines:
A deployment machine with Ansible. This machine should satisfy these prerequisites:
A bunch of target machines (machines that Ansible will deploy on them). These machines should have:
Now copy the project on the deployment machine, and refer to the Usage section.
Caution: Before starting make sure that the hostname of two nodes are different.
Cuation2: If you want to use sudo change become to True
0- chmod a+x mysql.yml kamailio.yml ha-tools.yml configure-ha.yml rtpproxy.yml
1- Edit hosts file to add your hosts
2- Edit settings.yml to customize things like MySQL settings, IP addresses, ... Here if you want to have an Active-Passive cluster with two nodes such that each node has a local RTPProxy server set withRTPProxyCluster to False (default setting). If you want to deploy a cluster of RTPProxy servers such that their settings is red from a MySQL server database set withRTPProxyCluster to True and configure other necessary variables.
3- Run mysql.yml to install your database server
4- Run kamailio.yml to install Kamailio
5- If you need a cluster of RTPProxy servers run rtpproxy.yml
6- Run ha-tools.yml to install HA tools
7- Run configure-ha.yml to configure HA tools
Author: Gholamreza Sabery Tabrizy
Email: reza_sabery_89@yahoo.com