Merge pull request #3 from gravyboat/master
Updates to add a jinja map, make the init support it, and updates to the readme.
This commit is contained in:
17
README.rst
17
README.rst
@@ -1,2 +1,19 @@
|
||||
========
|
||||
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
|
||||
postgresql:
|
||||
pkg.installed:
|
||||
{% if grains['os_family'] == 'RedHat' %}
|
||||
- name: postgresql
|
||||
{% elif grains['os_family'] == 'Debian' %}
|
||||
- name: postgresql-9.1
|
||||
{% endif %}
|
||||
{% from "postgres/map.jinja" import postgres with context %}
|
||||
|
||||
postgresql:
|
||||
pkg:
|
||||
- installed
|
||||
- name: {{ postgres.pkg }}
|
||||
|
||||
|
||||
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')) %}
|
||||
Reference in New Issue
Block a user