mirror of
https://github.com/batonogov/learn-devops.git
synced 2025-11-29 00:33:02 +00:00
* Описана инфрастуктура кластера * Добавлена роль etcd * Добавлена роль haproxy * Добавлена роль keepalived * Добавлена роль ntp_install * Добавлена роль patroni * Добавлена групповые переменные --------- Co-authored-by: Fedor Batonogov <f.batonogov@yandex.ru>
54 lines
1.1 KiB
YAML
54 lines
1.1 KiB
YAML
---
|
|
- name: Подготовка узлов
|
|
become: true
|
|
hosts:
|
|
- patroni_postgresql_hosts
|
|
roles:
|
|
- ntp_install
|
|
- docker_install
|
|
tasks:
|
|
- name: Создаю пользователя
|
|
ansible.builtin.user:
|
|
name: "{{ patroni_user }}"
|
|
uid: "{{ patroni_uid }}"
|
|
shell: /usr/sbin/nologin
|
|
groups:
|
|
- docker
|
|
|
|
- name: Подготовка кластера
|
|
become: true
|
|
hosts:
|
|
- patroni_postgresql_hosts
|
|
roles:
|
|
- etcd
|
|
- patroni
|
|
|
|
- name: Подготовка кластера
|
|
become: true
|
|
hosts:
|
|
- haproxy_hosts
|
|
roles:
|
|
- ntp_install
|
|
- docker_install
|
|
- haproxy
|
|
|
|
- name: Настройка master keepalived
|
|
become: true
|
|
hosts:
|
|
- haproxy-01
|
|
roles:
|
|
- role: keepalived
|
|
unit_file: "keepalived.master.conf.j2"
|
|
virtual_ip: "10.0.75.110/24"
|
|
virtual_router_id: 250
|
|
|
|
- name: Настройка backup keepalived
|
|
become: true
|
|
hosts:
|
|
- haproxy-02
|
|
roles:
|
|
- role: keepalived
|
|
unit_file: "keepalived.backup.conf.j2"
|
|
virtual_ip: "10.0.75.110/24"
|
|
virtual_router_id: 250
|