diff --git a/pillar.example b/pillar.example index 37029ce0..96de2319 100644 --- a/pillar.example +++ b/pillar.example @@ -4,15 +4,9 @@ postgres: # Version to install from upstream repository version: '9.3' - # These are Debian/Ubuntu specific package names - pkg: 'postgresql-9.3' - pkg_client: 'postgresql-client-9.3' - - # Additional packages to install with PostgreSQL server, - # this should be in a list format - pkgs_extra: - - postgresql-contrib - - postgresql-plpython + # Package names are defined in codenamemap.yaml and osmap.yaml + # Extra packages: ditto + pkgs_extra: [] # Append the lines under this item to your postgresql.conf file. # Pay attention to indent exactly with 4 spaces for all lines. @@ -58,7 +52,7 @@ postgres: # Use ``bake_image`` setting to control how PostgreSQL will be started: if set # to ``True`` the raw ``pg_ctl`` will be utilized instead of packaged init # script, job or unit run with Salt ``service`` state. - bake_image: True + # bake_image: True {%- endif %} diff --git a/postgres/osmap.yaml b/postgres/osmap.yaml index 2b38e025..ce262eb1 100644 --- a/postgres/osmap.yaml +++ b/postgres/osmap.yaml @@ -19,6 +19,17 @@ Debian: pkg_dev: postgresql-server-dev-all pkg_libpq_dev: libpq-dev + pkg: 'postgresql-{{ repo.version }}' + pkg_client: 'postgresql-client-{{ repo.version }}' + pkgs_extra: [ postgresql-contrib, postgresql-plpython-{{ repo.version }}, libpostgresql-jdbc-java] + python: python-psycopg2 + {% set data_dir = '/var/lib/postgresql/data' %} + conf_dir: {{ data_dir }} + prepare_cluster: + command: /usr/lib/postgresql/9.6/bin/initdb --pgdata={{ data_dir }} + test: test -f {{ data_dir }}/PG_VERSION + user: postgres + FreeBSD: user: pgsql @@ -39,12 +50,6 @@ RedHat: pkg: postgresql{{ release }}-server pkg_client: postgresql{{ release }} - conf_dir: /var/lib/pgsql/{{ repo.version }}/data - service: postgresql-{{ repo.version }} - - prepare_cluster: - command: initdb --pgdata='{{ data_dir }}' - test: test -f '{{ data_dir }}/PG_VERSION' # Directory containing PostgreSQL client executables bin_dir: /usr/pgsql-{{ repo.version }}/bin @@ -85,15 +90,30 @@ RedHat: {% else %} + {% set data_dir = '/var/lib/pgsql/data' %} pkg: postgresql-server pkg_client: postgresql {% endif %} + service: postgresql-{{ repo.version }} + pkgs_extra: [ postgresql-contrib, postgresql-plpython, postgresql-jdbc, postgresql-docs] + conf_dir: {{ data_dir }} + prepare_cluster: + command: initdb --pgdata='{{ data_dir }}' + test: test -f '{{ data_dir }}/PG_VERSION' + user: postgres + Suse: pkg: postgresql-server pkg_client: postgresql pkg_libpq_dev: postgresql + pkgs_extra: [ postgresql-contrib, postgresql-plpython, postgresql-jdbc, postgresql-docs] + {% set data_dir = '/var/lib/pgsql/data' %} + prepare_cluster: + command: /usr/lib/postgresql/bin/initdb --pgdata={{ data_dir }} + test: test -f {{ data_dir }}/PG_VERSION + user: postgres # vim: ft=sls diff --git a/postgres/repo.yaml b/postgres/repo.yaml index e37eec73..e1731226 100644 --- a/postgres/repo.yaml +++ b/postgres/repo.yaml @@ -1,5 +1,5 @@ # This file allows to get PostgreSQL version and upstream repo settings -# early from Pillar to set correct lookup dictionaty items +# early from Pillar to set correct lookup dictionary items {% import_yaml "postgres/defaults.yaml" as defaults %}