Ansible

This section describes set of administrative tools - scripts and applications that allow for automation of the TStorage cluster implementation process and its configuration using Ansible.

Ansible is an IT automation tool that enables configuration management, application deployment, and system orchestration in a simple and agentless manner.
Using declarative playbooks written in YAML, Ansible allows for quick and repeatable execution of administrative tasks across multiple servers simultaneously.
It is lightweight, easy to use, and relies on SSH, eliminating the need to install additional software on managed machines.

Requirements

  • Access to the TStorage Package Repository: https://pkgs.atende.industries/.

  • Root access to all servers.

  • Machine for Ansible management node (could be PC/Notebook) and group of servers for TStorage cluster nodes.

  • All TStorage machines should have the same number of disks to store data.

  • All data disks should be the same size.

How to prepare Ansible manager

It is essential to install the Python package installer (PIP). The best method is to use the package manager for specific Linux distribution: APT, DNF, YUM, Zypper, Pacman, etc.
Alternatively, Python installer can be used

curl -s -o get-pip.py -L https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py

It is also necessary to install the jmespath module, preferably using the system package manager: APT, DNF, YUM, Zypper, Pacman, etc.
Alternatively, Python package installer (PIP) can be used.

pip install jmespath

Next, using the Python package installer (PIP), Ansible should be installed:

pip install ansible ansible-core

How to prepare inventory

Ansible automates tasks on managed nodes or “hosts” in infrastructure, using a list or group of lists known as inventory.
Ansible composes inventory from one or more ‘inventory sources’, one of these can be the list of host names you pass at the command line, but most Ansible users create inventory files.
For the purposes of these tests, the inventory file should contain:

  1. A short, user-friendly hostname (it will appear in the summary of individual deployment steps).

  2. The ansible_host variable, specifying the server’s IP address.

  3. The ansible_user variable set to root (modifying system settings requires the process to be executed with the highest privileges).
    An example inventory file is attached named as example.inventory.

Test correct Ansible and inventory configuration

ansible -i example.inventory -a 'whoami' \*

TStorage deployment

To start deployment using Ansible, apply the tstorage role with the prepared Ansible playbook:

ansible-playbook -i inventory_file playbooks/tstorage-deploy.yml

After execution, a series of prompts will gather the necessary parameters for optimal TStorage cluster configuration.

If you have powerful enough machine as the Ansible manager, you can increase the parallel execution of deployment steps using the -f parameter:

ansible-playbook -f 12 -i inventory_file playbooks/tstorage-deploy.yml