- re-arrange cluster initialization to a set of variables in a dictionary

which control three things:
    1. should we initialize?
    2. if so, how?
    3. what environment variables and user to use
  The approach taken is very similar to what the Apache formula uses, namely:
  a default dictionary which is over-ridden by:
     os-specific defaults,
     then os codename defaults,
     then os finger defaults,
     and finally user-specified pillar values
- this also adds support for grains['osfinger']
This commit is contained in:
Jon Nelson
2016-07-08 15:34:45 -05:00
parent 783d78bde7
commit 0220b67a85
7 changed files with 78 additions and 60 deletions

View File

@@ -7,8 +7,6 @@ postgres:
python: python-psycopg2
service: postgresql
conf_dir: /var/lib/pgsql/data
data_dir: /var/lib/pgsql/data
version: 9.1
use_upstream_repo: False
users: {}
acls: []
@@ -17,10 +15,17 @@ postgres:
postgresconf_backup: True
postgresconf: ""
pg_hba.conf: salt://postgres/pg_hba.conf
initdb: True
initdb_user: root
initdb_args: --data-checksum
commands:
initdb: service postgresql initdb
user: postgres
group: postgres
# if prepare_cluster is over-ridden in any of:
# - osmap.yaml
# - oscodenamemap.yaml
# - osfingermap.yaml
# you will have to specify a complete dictionary.
prepare_cluster:
user: root
command: service postgresql initdb
test: test -f /var/lib/pgsql/data/PG_VERSION
env:
LC_ALL: C.UTF-8