Deploy with Ansible
Última actualización
Última actualización
It is essential to have a Linux distribution with Podman installed (3.0.0 or higher). Currently, modern operating systems like Debian, Ubuntu, Rocky, or Alma Linux, have repositories enabled that allow downloading it.
In the following section, we will cover the steps necessary to have OMniLeads running in containerized environments.
Note: If you are working on a VPS with a Public IP, it is mandatory to have a network interface dedicated to a Private IP.
To do this, we proceed to clone the project's Deploy Manager repository and position ourselves in the Ansible folder:
It is important to highlight that using the Deploy Manager with Ansible will allow us multiple administrative actions:
Managing OMniLeads Instances
Manage hundreds of OMniLeads instances in parallel using inventory files.
Conduct Disaster Recovery processes: backups & restores.
Perform upgrades & rollbacks.
Create new instances.
Below is a sketch of the container-based architecture and its involved components: For each operational instance, a collection of components is invoked using SystemD services, each running in a container. It is also possible to group these containers into separate physical instances (horizontal cluster) and give them redundancy and availability features (HA cluster).
Running the following command, we can interpret its possible uses: This bash script will be responsible for executing multiple actions on one or more tenants simultaneously. Basically, it searches for the inventory file according to the location specified on the command line and from there launches the Ansible "root" Playbook (matrix.yml). An instance of OMniLeads is deployed on a Linux server using SystemD and Podman, from a Bash Script that is fed with environment variables and uses a set of Ansible files for automation (Playbooks + Templates).
If the goal is to run installations, upgrades, backups, or restores, two fundamental parameters must be specified:
--action=
--tenant=
In the following example, the script will perform an installation action on the "tenant-folder," which contains the inventory file with the description and parameterization of its tenant(s).
Under this installation method, we will have the ability to manage containers (components) as traditional SystemD services.
Below is an example showcasing the SystemD file for the Nginx component: /etc/systemd/system/nginx.service:
Every action triggered by the systemctl command results in a Podman container being started, stopped, or restarted. This container arises from an image invoked based on the environment variables configured in the deployment.
Nginx will have its environment variables file defined as follows:
Depending on the structure of the inventory file and its defined variables, OMniLeads can be remotely deployed in 3 possible schemes:
Correr OMniLeads All in One con Podman & Systemd: All components represented in containers are deployed on the same Linux Host.
Correr OMniLeads Cluster con Podman & Systemd: Components are grouped in a Horizontal Cluster structure (useful for high traffic or high load scenarios).
Correr OMniLeads Cluster HA con Podman & Systemd: The components are grouped into two Active-Passive nodes for High Availability support.