-
-
Save billfehring/3f259e72ebf8f611e7ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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