Skip to content

Instantly share code, notes, and snippets.

@viq
Created June 4, 2014 22:18
Show Gist options
  • Save viq/56d6cc580cf637dd45c4 to your computer and use it in GitHub Desktop.
Save viq/56d6cc580cf637dd45c4 to your computer and use it in GitHub Desktop.
postgresql-server:
pkg.installed:
- name: {{ salt['pillar.get']('packages:postgres') }}
service:
- name: {{ salt['pillar.get']('services:postgres') }}
- running
- enable: True
- require:
- pkg: postgresql-server
- file: postgresql-server
{% if grains['os_family'] == 'RedHat' %}
- cmd: postgresql-server
cmd.wait:
- name: sleep 5 ; service postgresql initdb
- watch:
- pkg: postgresql-server
{% endif %}
file.append:
{% if grains['os_family'] == 'RedHat' %}
- name: /var/lib/pgsql/data/postgresql.conf
{% elif grains ['os_family'] == 'Debian' %}
- name: /etc/postgresql/9.1/main/postgresql.conf
{% endif %}
- text: "listen_addresses = '127.0.0.1'"
- require:
- pkg: postgresql-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment