mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 17:50:27 +00:00
Merge pull request #45 from dferrantelli/master
added client-only formula and required default values
This commit is contained in:
commit
98bb44df47
6 changed files with 39 additions and 9 deletions
|
@ -23,6 +23,11 @@ Installs the postgresql package.
|
|||
|
||||
Installs the postgresql python module
|
||||
|
||||
``postgres.client``
|
||||
-------------------
|
||||
|
||||
Installs the postgresql client
|
||||
|
||||
Testing
|
||||
=======
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ postgres:
|
|||
|
||||
lookup:
|
||||
pkg: 'postgresql-9.3'
|
||||
pkg_client: 'postgresql-client-9.3'
|
||||
pg_hba: '/etc/postgresql/9.3/main/pg_hba.conf'
|
||||
|
||||
users:
|
||||
|
|
17
postgres/client.sls
Normal file
17
postgres/client.sls
Normal file
|
@ -0,0 +1,17 @@
|
|||
{% from "postgres/map.jinja" import postgres with context %}
|
||||
|
||||
{% if salt['pillar.get']('postgres:use_upstream_repo') %}
|
||||
include:
|
||||
- postgres.upstream
|
||||
{% endif %}
|
||||
|
||||
install-postgresql-client:
|
||||
pkg.installed:
|
||||
- name: {{ postgres.pkg_client }}
|
||||
- refresh: {{ salt['pillar.get']('postgres:use_upstream_repo', False) }}
|
||||
|
||||
{% if postgres.pkg_libpq_dev != False %}
|
||||
install-postgres-libpq-dev:
|
||||
pkg.installed:
|
||||
- name: {{ postgres.pkg_libpq_dev }}
|
||||
{% endif %}
|
|
@ -1,15 +1,8 @@
|
|||
{% from "postgres/map.jinja" import postgres with context %}
|
||||
|
||||
{% if salt['pillar.get']('postgres:use_upstream_repo') %}
|
||||
install-postgresql-repo:
|
||||
pkgrepo.managed:
|
||||
- humanname: PostgreSQL Official Repository
|
||||
- name: {{ postgres.pkg_repo }}
|
||||
- keyid: B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
|
||||
- keyserver: keyserver.ubuntu.com
|
||||
- file: {{ postgres.pkg_repo_file }}
|
||||
- require_in:
|
||||
- install-postgresql
|
||||
include:
|
||||
- postgres.upstream
|
||||
{% endif %}
|
||||
|
||||
install-postgresql:
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
'pkg' : 'postgresql-server',
|
||||
'pkg_dev' : 'postgresql-devel',
|
||||
'pkg_libpq_dev' : 'postgresql-libs',
|
||||
'pkg_client' : 'postgresql-client',
|
||||
'python' : 'python-psycopg2',
|
||||
'service' : 'postgresql',
|
||||
'conf_dir' : '/var/lib/pgsql/data',
|
||||
|
@ -26,6 +27,7 @@
|
|||
'pkg' : 'postgresql',
|
||||
'pkg_dev' : 'postgresql-devel',
|
||||
'pkg_libpq_dev' : 'postgresql-libs',
|
||||
'pkg_client' : 'postgresql-client',
|
||||
'python' : 'python-psycopg2',
|
||||
'service' : 'postgresql',
|
||||
'conf_dir' : '/var/lib/pgsql/data',
|
||||
|
@ -37,6 +39,7 @@
|
|||
'pkg' : 'postgresql-' + pg_version.id,
|
||||
'pkg_dev' : 'postgresql-server-dev-' + pg_version.id,
|
||||
'pkg_libpq_dev' : 'libpq-dev',
|
||||
'pkg_client' : 'postgresql-client-'+ pg_version.id,
|
||||
'pkg_contrib' : 'postgresql-contrib-' + pg_version.id,
|
||||
'pkg_repo' : 'deb http://apt.postgresql.org/pub/repos/apt/ ' + grains['lsb_distrib_codename'] + '-pgdg main',
|
||||
'pkg_repo_file' : '/etc/apt/sources.list.d/pgdg.list',
|
||||
|
|
11
postgres/upstream.sls
Normal file
11
postgres/upstream.sls
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% from "postgres/map.jinja" import postgres with context %}
|
||||
|
||||
{% if grains['os'] == 'Ubuntu' %} # Other distro support should be added here
|
||||
install-postgresql-repo:
|
||||
pkgrepo.managed:
|
||||
- humanname: PostgreSQL Official Repository
|
||||
- name: {{ postgres.pkg_repo }}
|
||||
- keyid: B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
|
||||
- keyserver: keyserver.ubuntu.com
|
||||
- file: {{ postgres.pkg_repo_file }}
|
||||
{% endif %}
|
Loading…
Add table
Reference in a new issue