Gitlab + Ansible: Add to the Redis service and access configuration
We have a work script on Gitlab + Ansible which:
A. 1 Starts the car in the Hetzner cloud, installs CentOS on it
A .2 Configurate the necessary services (nginx, PHP, etc.)A .3 Download the PHP code from BitBucket
A .4 records access (e.g. to DB servers) from Gitlab CI Variables to PHP configuration files
The script has a short documentation of 10 pages (in English).There is also (very limited) access to a specialist who has set it all up (in Russian).In this existing script you need to add the following functions:
B 1 . Installing the Redis cache service on the server
B .2 Configuration of the Redis service:
1) to open Redis ports for certain IP addresses
2) add three different hosts, ports, access, passwords for the Redis service in Gitlab CI Variables
Results after successful completion:
1 .The installation and setting of Redis is similar to the installation and setting of nginx described above, i.e.We make a new role, break the script into handlers, tasks, templates.2ndWe use the Gitlab CI Variables.We do not use any secret data (access, passwords) in the script itself.ThreeStarting the server works without errors, as it worked before (see.points A.1-A.4 above)
4 .The Redis service is available to our apps, everyone can store data in this service and read from it, so all apps can exchange data with each other.and 5.There are no new holes in the server security system (we’ll check on Vulnerabilities by the Nessus scanner).We are waiting for your bets!Please ask all your questions about the task before you start working so that you have a full understanding of the expected result.We will answer your questions personally and also update this task so that everyone will see new details.1) a file with a full structure of maps and files in the master branch on Gitlab.As you can see, each component on the server lies in a separate folder in config_new_platform/roles (e.g., nginx).file config_new_platform/site.yml
As you can see, this file simply shows a list of roles you need to perform (e.g., nginx).3) files config_new_platform/roles/nginx:
a) handlers/main.yml
b) tasks/main.yml
c) templates/default.conf
c) templates/nginx.conf
As you can see, these files use the variables from the Gitlab CI Variables, for example {{ TF_VAR_HOSTNAME }} => the host name in the term or {{ SSL_privkey }} => SSL certificate
Пришли два вопроса:
1. При чем Терраформ?
Один скрипт Терраформ поднимает на выбор один из 3 серверов с приложениями (DEV, TEST, PROD) и соответствующий ему сервер с БД и микросервисами (DB DEV, DB TEST, DB PROD).
Сервис Redis нужно именно запустить на сервере с БД и микросервисами. А микросервисы и приложения с обеих серверов будут с ним работать, доступы у них будут в локальных конфиг-файлах. То есть, в принципе Терраформ не причем.
2. Как отлаживать?
Сервер DEV с приложениями и БД сервер DB DEV с микросервисами и с сервисом Redis полностью в Вашем распоряжении. На сервер DEV будет загружаться код, который будет пытаться соединиться с сервисом Redis на DB DEV. Таким образом, Вы легко увидите, работает ли сервис так, как должен.
Applications 5
Client's review of cooperation with Mihail Savin
Gitlab + Ansible: Add to the Redis service and access configurationThank you very much, it’s all great! We are pleased and will be addressed in the future.
Freelancer's review of cooperation with Nikolaus Haufler
Gitlab + Ansible: Add to the Redis service and access configurationA great customer! A clear task, a professional view of the task. I strongly recommend cooperation!
Current freelance projects in the category DevOps
Elimination of load issues on WordPress/WooCommerce hosting siteWe are looking for a specialist to diagnose and resolve issues with the load on the WordPress/WooCommerce hosting site. There is an active e-commerce site on WordPress + WooCommerce. The site periodically crashes or works unstably during a high number of requests — from various… DevOps, Web Programming ∙ 4 hours 44 minutes back ∙ 37 proposals |
Integration of Google Analytics into CRM via n8nGood day, I need help connecting Google Analytics and CRM through n8n. All settings on the CRM side are done. Now we just need to set up the analytics through n8n to transmit sales events. DevOps, System & Network Administration ∙ 6 hours 2 minutes back ∙ 15 proposals |
Setting up a backup system and optimizing server infrastructureObjective of the work: Ensure reliable data storage for the CRM system and application by implementing an automated backup system, as well as carry out a series of server improvements to enhance the stability, security, and performance of the infrastructure. DevOps, Databases & SQL ∙ 9 days back ∙ 29 proposals |