Merge branch '21606-keep-web-output-buffer'
[arvados.git] / tools / salt-install / config_examples / multi_host / aws / pillars / postgresql.sls
1 ---
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 {%- set domain = "__DOMAIN__" %}
7 {%- set controller_nodes = "__CONTROLLER_NODES__".split(",") %}
8 {%- set websocket_ip = "__WEBSOCKET_INT_IP__" %}
9 {%- set keepbalance_ip = "__KEEPBALANCE_INT_IP__" %}
10 {%- set pg_version = "__DATABASE_POSTGRESQL_VERSION__" %}
11
12 ### POSTGRESQL
13 postgres:
14   pkgs_extra:
15     - postgresql-contrib
16   use_upstream_repo: true
17   version: {{ pg_version }}
18   postgresconf: |-
19     listen_addresses = '*'  # listen on all interfaces
20   acls:
21     - ['local', 'all', 'postgres', 'peer']
22     - ['local', 'all', 'all', 'peer']
23     - ['host', 'all', 'all', '127.0.0.1/32', 'md5']
24     - ['host', 'all', 'all', '::1/128', 'md5']
25     - ['host', '__CLUSTER___arvados', '__CLUSTER___arvados', '127.0.0.1/32']
26     - ['host', '__CLUSTER___arvados', '__CLUSTER___arvados', '{{ websocket_ip }}/32']
27     - ['host', '__CLUSTER___arvados', '__CLUSTER___arvados', '{{ keepbalance_ip }}/32']
28     {%- for controller_hostname in controller_nodes %}
29     {%- set controller_ip = salt['cmd.run']("getent hosts "+controller_hostname+" | awk '{print $1 ; exit}'", python_shell=True) %}
30     - ['host', '__CLUSTER___arvados', '__CLUSTER___arvados', '{{ controller_ip }}/32']
31     {%- endfor %}
32   users:
33     __CLUSTER___arvados:
34       ensure: present
35       password: "__DATABASE_PASSWORD__"
36     prometheus:
37       ensure: present
38   databases:
39     __CLUSTER___arvados:
40       owner: __CLUSTER___arvados
41       template: template0
42       lc_ctype: en_US.utf8
43       lc_collate: en_US.utf8
44       schemas:
45         public:
46           owner: __CLUSTER___arvados
47       extensions:
48         pg_trgm:
49           if_not_exists: true
50           schema: public