Skip to content

Commit

Permalink
fix readme and update maxconn
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahms authored and vibhorkumar123 committed Aug 21, 2023
1 parent a1e051c commit d97db71
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
61 changes: 60 additions & 1 deletion roles/setup_haproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,63 @@ all:
proxy_location: 'zone_1'
etcd: true
etcd_cluster_name: 'patroni-etcd'
```
```

### How to include the `setup_haproxy` role in your Playbook

Below is an example of how to include the `setup_haproxy` role:

```yaml
---
- hosts: all
name: Deploy haproxy
become: yes
gather_facts: yes
any_errors_fatal: true
collections:
- edb_devops.edb_postgres
pre_tasks:
- name: Initialize the user defined variables
set_fact:
pg_version: 15
pg_type: "PG"
roles:
- role: setup_repo
when: "'setup_repo' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: install_dbserver
when: "'install_dbserver' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: setup_etcd
when: "'setup_etcd' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: setup_patroni
when: "'setup_patroni' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: setup_pgbouncer
when: "'setup_pgbouncer' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: setup_haproxy
when: "'setup_haproxy' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: manage_pgbouncer
when: "'manage_pgbouncer' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: manage_dbserver
when: "'manage_dbserver' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
```

Defining and adding variables is done in the `set_fact` of the `pre_tasks`.

All the variables are available at:

* [/roles/setup_haproxy/defaults/main.yml](./defaults/main.yml)

## License

BSD

## Author information

Author:

* Hannah Stoik
* Vibhor Kumar (Reviewer)
* EDB Postgres
* [email protected] www.enterprisedb.com
2 changes: 1 addition & 1 deletion roles/setup_haproxy/tasks/haproxy_configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
haproxy_server_lines: >-
{{ haproxy_server_lines | default([]) + [
"server " + node.inventory_hostname + " " + node.private_ip | string + ":" + pg_port | string + " " +
"maxconn 100 check port " + patroni_rest_api_port | string
"maxconn " + haproxy_global_maxconn | string + " check port " + patroni_rest_api_port | string
]
}}
loop: "{{ haproxy_backend_nodes }}"
Expand Down

0 comments on commit d97db71

Please sign in to comment.