From 62b7d6c47f4cb8c84f61872fb6281658db9d396d Mon Sep 17 00:00:00 2001 From: Niels Abspoel Date: Sun, 9 Feb 2014 17:50:23 +0100 Subject: [PATCH] updated postgresql module added service added python module added archlinux support --- README.rst | 5 +++++ postgres/init.sls | 6 ++++++ postgres/map.jinja | 9 +++++++++ postgres/python.sls | 6 ++++++ 4 files changed, 26 insertions(+) create mode 100644 postgres/python.sls diff --git a/README.rst b/README.rst index 1020139..ea11452 100644 --- a/README.rst +++ b/README.rst @@ -17,3 +17,8 @@ Available states ------------ Installs the postgresql package. + +``postgres.python`` +------------------- + +Installs the postgresql python module diff --git a/postgres/init.sls b/postgres/init.sls index a5345c5..7d2f9ca 100644 --- a/postgres/init.sls +++ b/postgres/init.sls @@ -4,4 +4,10 @@ postgresql: pkg: - installed - name: {{ postgres.pkg }} + service: + - running + - enable: true + - name: {{ postgres.service }} + - require: + - pkg: {{ postgres.pkg }} diff --git a/postgres/map.jinja b/postgres/map.jinja index 03963cb..9c4dfd3 100644 --- a/postgres/map.jinja +++ b/postgres/map.jinja @@ -1,8 +1,17 @@ {% set postgres = salt['grains.filter_by']({ 'Debian': { 'pkg': 'postgresql-9.1', + 'python': 'python-pygresql', + 'service': 'postgresql-9-1', }, 'RedHat': { 'pkg': 'postgresql', + 'python': 'postgresql-python', + 'service': 'postgresql', + }, + 'Arch': { + 'pkg': 'postgresql', + 'python': 'python-psycopg2', + 'service': 'postgresql', }, }, merge=salt['pillar.get']('postgres:lookup')) %} diff --git a/postgres/python.sls b/postgres/python.sls new file mode 100644 index 0000000..b2199e7 --- /dev/null +++ b/postgres/python.sls @@ -0,0 +1,6 @@ +{% from "postgres/map.jinja" import postgres with context %} + +postgresql-python: + pkg: + - installed + - name: {{ postgresql.python}}