Skip to content

Instantly share code, notes, and snippets.

@billfehring
Created September 6, 2013 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billfehring/3f259e72ebf8f611e7ee to your computer and use it in GitHub Desktop.
Save billfehring/3f259e72ebf8f611e7ee to your computer and use it in GitHub Desktop.
{% if grains['os'] == 'FreeBSD' and '/zpath/db' in salt['mount.active']() %}
postgres-server-pkg:
pkg.installed:
- name: postgresql-server
/etc/rc.conf:
file.append:
- text:
- postgresql_enable="YES"
- postgresql_data="/zpath/db"
- postgresql_flags="-w -s -m fast"
- postgresql_initdb_flags="--encoding=utf-8 --lc-collate=C"
- postgresql_class="default"
- postgresql_profiles=""
init_postgres_db:
cmd.run:
- unless: stat /zpath/db/postgresql.conf
- name: /usr/local/etc/rc.d/postgresql initdb && /usr/local/etc/rc.d/postgresql start
- require:
- pkg: postgres-server-pkg
{% if salt['file.file_exists']('/zpath/db/postgresql.conf') %}
postgresql:
service:
- running
- require:
- pkg: postgres-server-pkg
{% endif %}
include:
- zpath.postgres.database
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment