Files
learn-devops/ansible/patroni-postgresql.yml
github-actions[bot] f8fe304cd9 patroni-postgresql-cluster (#13)
* Описана инфрастуктура кластера

* Добавлена роль etcd

* Добавлена роль haproxy

* Добавлена роль keepalived

* Добавлена роль ntp_install

* Добавлена роль patroni

* Добавлена групповые переменные

---------

Co-authored-by: Fedor Batonogov <f.batonogov@yandex.ru>
2024-06-18 10:37:21 +03:00

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