mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 01:30:25 +00:00
Updated postgres to add the map, and modified the init to support this. Updated readme as well.
This commit is contained in:
parent
7b65e18e3d
commit
1ed1159748
3 changed files with 31 additions and 8 deletions
17
README.rst
17
README.rst
|
@ -1,2 +1,19 @@
|
||||||
|
=======
|
||||||
postgres
|
postgres
|
||||||
========
|
========
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
See the full `Salt Formulas installation and usage instructions
|
||||||
|
<http://docs.saltstack.com/topics/conventions/formulas.html>`_.
|
||||||
|
|
||||||
|
Available states
|
||||||
|
================
|
||||||
|
|
||||||
|
.. contesnt::
|
||||||
|
:local:
|
||||||
|
|
||||||
|
``postgres``
|
||||||
|
------------
|
||||||
|
|
||||||
|
Installs the postgresql package.
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
# pkg.install
|
{% from postgres/map.jinja import postgres with context %}
|
||||||
postgresql:
|
|
||||||
pkg.installed:
|
postgresql:
|
||||||
{% if grains['os_family'] == 'RedHat' %}
|
pkg:
|
||||||
- name: postgresql
|
- installed
|
||||||
{% elif grains['os_family'] == 'Debian' %}
|
- name: {{ postgres.pkg }}
|
||||||
- name: postgresql-9.1
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
8
postgres/map.jinja
Normal file
8
postgres/map.jinja
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{% set postgres = salt['grains.filter_by']({
|
||||||
|
'Debian': {
|
||||||
|
'pkg': 'postgresql-9.1',
|
||||||
|
},
|
||||||
|
'RedHat': {
|
||||||
|
'pkg': 'postgresql',
|
||||||
|
},
|
||||||
|
}, merge=salt['pillar.get']('postgres:lookup')) %}
|
Loading…
Add table
Reference in a new issue