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

Parameters for patroni etcd username, password and namespace #473

Merged
merged 10 commits into from
Sep 26, 2023
11 changes: 10 additions & 1 deletion roles/patroni/templates/patroni.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

scope: {{ patroni_cluster_name }}
name: {{ ansible_hostname }}
namespace: /service/
namespace: {{ patroni_etcd_namespace | default("/service/") }}

{% if patroni_log_destination == 'logfile' %}
log:
Expand Down Expand Up @@ -36,6 +36,15 @@ etcd3:
{% if dcs_exists|bool and dcs_type == 'etcd' %}
etcd3:
hosts: {% for etcd_hosts in patroni_etcd_hosts %}{{etcd_hosts.host}}:{{etcd_hosts.port}}{% if not loop.last %},{% endif %}{% endfor %}
{% if patroni_etcd_username | default("") | length > 0 %}
username: {{ patroni_etcd_username | default("") }}
{% endif %}
{% if patroni_etcd_password | default("") | length > 0 %}
password: {{ patroni_etcd_password }}
{% endif %}
{% if patroni_etcd_protocol | default("") | length > 0 %}
lavr marked this conversation as resolved.
Show resolved Hide resolved
protocol: {{ patroni_etcd_protocol }}
{% endif %}
{% endif %}

{% if dcs_type == 'consul' %}
Expand Down
4 changes: 4 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
# - { host: "10.128.64.140", port: "2379" }
# - { host: "10.128.64.142", port: "2379" }
# - { host: "10.128.64.143", port: "2379" }
patroni_etcd_namespace: "/service/" # (optional) etcd namespace for patroni cluster
patroni_etcd_username: "" # (optional) username for etcd authentication

Check failure on line 69 in vars/main.yml

View workflow job for this annotation

GitHub Actions / build

yaml[colons]

Too many spaces after colon

Check failure on line 69 in vars/main.yml

View workflow job for this annotation

GitHub Actions / build

69:24 [colons] too many spaces after colon
vitabaks marked this conversation as resolved.
Show resolved Hide resolved
patroni_etcd_password: "" # (optional) password for etcd authentication

Check failure on line 70 in vars/main.yml

View workflow job for this annotation

GitHub Actions / build

yaml[colons]

Too many spaces after colon

Check failure on line 70 in vars/main.yml

View workflow job for this annotation

GitHub Actions / build

70:24 [colons] too many spaces after colon
vitabaks marked this conversation as resolved.
Show resolved Hide resolved
patroni_etcd_protocol: "" # (optional) http or https, if not specified http is used

Check failure on line 71 in vars/main.yml

View workflow job for this annotation

GitHub Actions / build

yaml[colons]

Too many spaces after colon

Check failure on line 71 in vars/main.yml

View workflow job for this annotation

GitHub Actions / build

71:24 [colons] too many spaces after colon
vitabaks marked this conversation as resolved.
Show resolved Hide resolved

# more options you can specify in the roles/patroni/templates/patroni.yml.j2
# https://patroni.readthedocs.io/en/latest/SETTINGS.html#etcd
Expand Down
Loading