diff --git a/README.rst b/README.rst index 8c9b945..b193291 100644 --- a/README.rst +++ b/README.rst @@ -1,2 +1,19 @@ +======= postgres ======== + +.. note:: + + See the full `Salt Formulas installation and usage instructions + `_. + +Available states +================ + +.. contesnt:: + :local: + +``postgres`` +------------ + +Installs the postgresql package. diff --git a/postgres/init.sls b/postgres/init.sls index 727c4fc..d591ccc 100644 --- a/postgres/init.sls +++ b/postgres/init.sls @@ -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 }} diff --git a/postgres/map.jinja b/postgres/map.jinja new file mode 100644 index 0000000..03963cb --- /dev/null +++ b/postgres/map.jinja @@ -0,0 +1,8 @@ +{% set postgres = salt['grains.filter_by']({ + 'Debian': { + 'pkg': 'postgresql-9.1', + }, + 'RedHat': { + 'pkg': 'postgresql', + }, +}, merge=salt['pillar.get']('postgres:lookup')) %}