postgres-formula/postgres/map.jinja
Will Saxon a58f153fb1 Remove duplication in map.jinja
This change addresses #26 by consolidating Ubuntu and Debian
configuration back under the 'Debian' os_family grain.

The main difference between the various Ubuntu and Debian versions is
the version of postgresql in use; package/service names and directory
patterns are identical. This change separates the version number into
its own pg_version dictionary, which is used as needed by the postgres
dictionary.
2014-12-31 16:58:41 -05:00

48 lines
1.8 KiB
Django/Jinja

{% set pg_version = salt['grains.filter_by']({
'RedHat' : { 'id': '9.1' },
'Arch' : { 'id': '9.1' },
'Debian' : { 'id': '9.3' },
}, merge=salt['grains.filter_by']({
'14.04' : { 'id': '9.3' },
'14.10' : { 'id': '9.4' },
}, grain='lsb_distrib_release', merge=salt['grains.filter_by']({
'jessie' : { 'id': '9.4' },
'wheezy' : { 'id': '9.1' },
}, grain='lsb_distrib_codename', merge=salt['pillar.get']('postgres:lookup')))) %}
{% set postgres = salt['grains.filter_by']({
'RedHat': {
'pkg' : 'postgresql-server',
'pkg_dev' : 'postgresql-devel',
'pkg_libpq_dev' : 'postgresql-libs',
'python' : 'python-psycopg2',
'service' : 'postgresql',
'conf_dir' : '/var/lib/pgsql/data',
'create_cluster' : False,
'init_db' : True,
'version' : pg_version.id,
},
'Arch': {
'pkg' : 'postgresql',
'pkg_dev' : 'postgresql-devel',
'pkg_libpq_dev' : 'postgresql-libs',
'python' : 'python-psycopg2',
'service' : 'postgresql',
'conf_dir' : '/var/lib/pgsql/data',
'create_cluster' : False,
'init_db' : True,
'version' : pg_version.id,
},
'Debian': {
'pkg' : 'postgresql',
'pkg_dev' : 'postgresql-server-dev-' + pg_version.id,
'pkg_libpq_dev' : 'libpq-dev',
'python' : 'python-pygresql',
'service' : 'postgresql',
'pg_hba' : '/etc/postgresql/' + pg_version.id + '/main/pg_hba.conf',
'conf_dir' : '/etc/postgresql/' + pg_version.id + '/main',
'create_cluster' : False,
'init_db' : False,
'version' : pg_version.id,
},
}, merge=salt['pillar.get']('postgres:lookup')) %}