20610: Changes the default installer config in order to simplify documentation.
[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
11 ### POSTGRESQL
12 postgres:
13   pkgs_extra:
14     - postgresql-contrib
15   use_upstream_repo: true
16   version: '12'
17   postgresconf: |-
18     listen_addresses = '*'  # listen on all interfaces
19   acls:
20     - ['local', 'all', 'postgres', 'peer']
21     - ['local', 'all', 'all', 'peer']
22     - ['host', 'all', 'all', '127.0.0.1/32', 'md5']
23     - ['host', 'all', 'all', '::1/128', 'md5']
24     - ['host', '__CLUSTER___arvados', '__CLUSTER___arvados', '127.0.0.1/32']
25     - ['host', '__CLUSTER___arvados', '__CLUSTER___arvados', '{{ websocket_ip }}/32']
26     - ['host', '__CLUSTER___arvados', '__CLUSTER___arvados', '{{ keepbalance_ip }}/32']
27     {%- for controller_hostname in controller_nodes %}
28     {%- set controller_ip = salt['cmd.run']("getent hosts "+controller_hostname+" | awk '{print $1 ; exit}'", python_shell=True) %}
29     - ['host', '__CLUSTER___arvados', '__CLUSTER___arvados', '{{ controller_ip }}/32']
30     {%- endfor %}
31   users:
32     __CLUSTER___arvados:
33       ensure: present
34       password: "__DATABASE_PASSWORD__"
35     prometheus:
36       ensure: present
37   databases:
38     __CLUSTER___arvados:
39       owner: __CLUSTER___arvados
40       template: template0
41       lc_ctype: en_US.utf8
42       lc_collate: en_US.utf8
43       schemas:
44         public:
45           owner: __CLUSTER___arvados
46       extensions:
47         pg_trgm:
48           if_not_exists: true
49           schema: public