Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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
You can’t perform that action at this time.