mirror of
https://gitea.0xace.cc/ansible-galaxy/patroni.git
synced 2024-11-24 23:56:39 +00:00
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
|
- name: Make sure handlers are flushed immediately
|
||
|
meta: flush_handlers
|
||
|
|
||
|
- name: Load a variable file based on the OS type
|
||
|
include_vars: "{{ lookup('first_found', params) }}"
|
||
|
vars:
|
||
|
params:
|
||
|
files:
|
||
|
- "{{ ansible_facts['distribution'] }}.yaml"
|
||
|
- "{{ ansible_facts['os_family'] }}.yaml"
|
||
|
paths:
|
||
|
- "vars"
|
||
|
tags: always, patroni_vars
|
||
|
|
||
|
- name: Task name
|
||
|
stat:
|
||
|
path: /etc/patroni/patroni.yaml
|
||
|
register: patroni_config
|
||
|
|
||
|
- name: "Install Patroni for {{ ansible_facts['os_family'] }}"
|
||
|
include_tasks: "{{ ansible_facts['os_family'] }}/main.yaml"
|
||
|
tags: patroni_install
|
||
|
|
||
|
- name: "Bootstrap Patroni configuration"
|
||
|
include_tasks: config.yaml
|
||
|
when: not patroni_config.stat.exists
|
||
|
tags: patroni_configure
|
||
|
|
||
|
- name: Enable and start patroni
|
||
|
systemd:
|
||
|
daemon_reload: true
|
||
|
name: patroni
|
||
|
enabled: true
|
||
|
state: started
|
||
|
masked: no
|
||
|
register: patroni_enable_and_start
|
||
|
tags: patroni, patroni_start
|
||
|
|
||
|
- name: "Dynamic Patroni configuration"
|
||
|
include_tasks: dynamic_config.yaml
|
||
|
when:
|
||
|
#- patroni_config.stat.exists
|
||
|
- patroni_postgresql_dynamic_parameters
|
||
|
tags: patroni_dynamic_configure
|
||
|
|