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

Changes in confd and haproxy roles. #231

Merged
merged 5 commits into from
Dec 15, 2022
Merged
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
8 changes: 8 additions & 0 deletions config_pgcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
msg: "Ansible version must be {{ minimal_ansible_version }} or higher"
when: ansible_version.full is version(minimal_ansible_version, '<')

- name: Set maintenance variable
hosts: all
tasks:
- name: Set variable
set_fact:
postgresql_cluster_maintenance: true
tags: always

- name: Gathering facts from all servers
hosts: all
gather_facts: true
Expand Down
2 changes: 1 addition & 1 deletion roles/confd/templates/confd.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nodes = [
{% endif %}
{% if dcs_exists|bool and dcs_type == 'etcd' %}
{% for etcd_hosts in patroni_etcd_hosts %}
{{etcd_hosts.host}}:{{etcd_hosts.port}},
"http://{{etcd_hosts.host}}:{{etcd_hosts.port}}",
{% endfor %}
{% endif %}
]
3 changes: 2 additions & 1 deletion roles/haproxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@
owner: haproxy
group: haproxy
notify: "restart haproxy"
when: add_balancer is not defined or not add_balancer|bool
when: (add_balancer is not defined or not add_balancer|bool) and
(postgresql_cluster_maintenance is not defined or not postgresql_cluster_maintenance|bool)
tags: haproxy, haproxy_conf, load_balancing

- name: Generate systemd service file "/etc/systemd/system/haproxy.service"
Expand Down