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

Enable SSL in haproxy.cfg if patroni_restapi_certfile is defined #104

Open
wants to merge 3 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
20 changes: 10 additions & 10 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ patroni_log_loggers:
patroni_restapi_port: 8008
patroni_restapi_connect_address: "{{ ansible_host }}:{{ patroni_restapi_port }}"
patroni_restapi_listen: "0.0.0.0:{{ patroni_restapi_port }}"
patroni_restapi_username: ""
patroni_restapi_password: ""
patroni_restapi_certfile: ""
patroni_restapi_keyfile: ""
patroni_restapi_keyfile_password: ""
patroni_restapi_cafile: ""
patroni_restapi_ciphers: ""
patroni_restapi_verify_client: ""
patroni_restapi_http_extra_headers: ""
patroni_restapi_https_extra_headers: ""
# patroni_restapi_username: ""
# patroni_restapi_password: ""
# patroni_restapi_certfile: ""
# patroni_restapi_keyfile: ""
# patroni_restapi_keyfile_password: ""
# patroni_restapi_cafile: ""
# patroni_restapi_ciphers: ""
# patroni_restapi_verify_client: ""
# patroni_restapi_http_extra_headers: ""
# patroni_restapi_https_extra_headers: ""

patroni_dcs: etcd
patroni_dcs_exists: true
Expand Down
4 changes: 2 additions & 2 deletions templates/haproxy.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ listen master
http-check expect status 200
default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions
{% for server in patroni_haproxy_servers %}
server {{ server.name }} {{ server.ip }}:{{ server.port }} maxconn 100 check port {{ patroni_restapi_port }}
server {{ server.name }} {{ server.ip }}:{{ server.port }} maxconn 100 check port {{ patroni_restapi_port }}{% if patroni_restapi_certfile is defined %} check-ssl verify none{% endif %}
{% endfor %}

listen replicas
Expand All @@ -31,5 +31,5 @@ listen replicas
http-check expect status 200
default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions
{% for server in patroni_haproxy_servers %}
server {{ server.name }} {{ server.ip }}:{{ server.port }} maxconn 100 check port {{ patroni_restapi_port }}
server {{ server.name }} {{ server.ip }}:{{ server.port }} maxconn 100 check port {{ patroni_restapi_port }}{% if patroni_restapi_certfile is defined %} check-ssl verify none{% endif %}
{% endfor %}