Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to set some variables without manually edit vars file #841

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion automation/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ postgresql_data_dir: "\
{% if cloud_provider | default('') | length > 0 %}\
{{ pg_data_mount_path | default('/pgdata') }}/{{ postgresql_version }}/{{ postgresql_cluster_name }}\
{% else %}\
/var/lib/postgresql/{{ postgresql_version }}/{{ postgresql_cluster_name }}\
{{ env_postgresql_data_dir | default('/var/lib/postgresql/' ~ postgresql_version ~ '/' ~ postgresql_cluster_name) }}\
{% endif %}"
# Note: When deploying to cloud providers, we create a disk and mount the data directory,
# along the path defined in the 'pg_data_mount_path' variable (or use '/pgdata' by default).
Expand Down
2 changes: 1 addition & 1 deletion automation/vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ postgresql_data_dir: "\
{% if cloud_provider | default('') | length > 0 %}\
{{ pg_data_mount_path | default('/pgdata') }}/{{ postgresql_version }}/data\
{% else %}\
/var/lib/pgsql/{{ postgresql_version }}/data\
{{ env_postgresql_data_dir | default('/var/lib/pgsql/' ~ postgresql_version ~ '/data') }}\
{% endif %}"
# Note: When deploying to cloud providers, we create a disk and mount the data directory,
# along the path defined in the 'pg_data_mount_path' variable (or use '/pgdata' by default).
Expand Down
6 changes: 3 additions & 3 deletions automation/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ proxy_env: {} # yamllint disable rule:braces
# ---------------------------------------------------------------------

# Cluster variables
cluster_vip: "" # IP address for client access to the databases in the cluster (optional).
cluster_vip: "{{ env_cluster_vip | default('') }}" # IP address for client access to the databases in the cluster (optional).
vip_interface: "{{ ansible_default_ipv4.interface }}" # interface name (e.g., "ens32").
# Note: VIP-based solutions such as keepalived or vip-manager may not function correctly in cloud environments.

Expand All @@ -23,7 +23,7 @@ synchronous_mode_strict: false # if 'true' then block all client writes to the
synchronous_node_count: 1 # number of synchronous standby databases

# Load Balancing
with_haproxy_load_balancing: false # or 'true' if you want to install and configure the load-balancing
with_haproxy_load_balancing: "{{ env_with_haproxy_load_balancing | default(false) }}" # or 'true' if you want to install and configure the load-balancing
haproxy_listen_port:
master: 5000
replicas: 5001
Expand Down Expand Up @@ -173,7 +173,7 @@ consul_services:


# PostgreSQL variables
postgresql_version: 17
postgresql_version: "{{ env_postgresql_version | default('17') }}"
# postgresql_data_dir: see vars/Debian.yml or vars/RedHat.yml
postgresql_listen_addr: "0.0.0.0" # Listen on all interfaces. Or use "{{ inventory_hostname }},127.0.0.1" to listen on a specific IP address.
postgresql_port: 5432
Expand Down
33 changes: 33 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
galaxy_info:
role_name: postgresql_cluster
description: PostgreSQL High-Availability Cluster (based on Patroni)
namespace: vitabaks
author: Vitaliy Kukharik (vitabaks@gmail.com)
license: MIT

min_ansible_version: "2.11.0"

platforms:
- name: EL
versions:
- "7"
- "8"
- "9"
- name: Debian
versions:
- buster
- bullseye
- name: Ubuntu
versions:
- bionic
- focal
- jammy

galaxy_tags:
- postgresql
- cluster
- patroni
- etcd

dependencies: []
2 changes: 2 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
requires_ansible: '>=2.14.0'