Skip to content

Instantly share code, notes, and snippets.

@flowolf
Last active May 17, 2016 06:15
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 flowolf/b902a6c5e06f8e529940e77e61ab7fab to your computer and use it in GitHub Desktop.
Save flowolf/b902a6c5e06f8e529940e77e61ab7fab to your computer and use it in GitHub Desktop.
# my working salt postgres config (updated since first post on IRC #salt)
postgres_server:
pkg:
- installed
- pkgs:
- postgresql
service:
- running
- name: postgresql
- enable: True
my_db_user:
postgres_user.present:
- name: {{ pillar['my_db']['user'] }}
- password: {{ pillar['my_db']['password'] }}
my_db:
postgres_database.present:
- name: {{ pillar['my_db']['name'] }}
- owner: {{ pillar['my_db']['user'] }}
# important not to use UTF-8 but UTF8, database will create fine, but will print error on second run.
- encoding: UTF8
- require:
- postgres_user: {{ pillar['my_db']['user'] }}
## too much info, didn't need that:
## - user: postgres
## - db_user: {{ pillar['my_db']['user'] }}
## - db_password: {{ pillar['my_db']['password'] }}
## - db_host: 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment