- 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

@@ -1,9 +1,13 @@
{%- macro ubuntu_block(name, version) %}
{{ name }}:
version: {{ version }}
pkg_repo: deb http://apt.postgresql.org/pub/repos/apt/ {{ name }}-pgdg main
conf_dir: /etc/postgresql/{{ version }}/main
data_dir: /var/lib/postgresql/{{ version }}/main
prepare_cluster:
command: pg_createcluster {{ version }} main
test: test -f /var/lib/postgresql/{{ version }}/main/PG_VERSION && test -f /etc/postgresql/{{ version }}/main/postgresql.conf
user: root
env:
LC_ALL: C.UTF-8
{%- endmacro %}
{{ ubuntu_block('wheezy', 9.1) }}