Skip to content

Instantly share code, notes, and snippets.

@UtahDave
Created April 18, 2014 17:33
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 UtahDave/11055416 to your computer and use it in GitHub Desktop.
Save UtahDave/11055416 to your computer and use it in GitHub Desktop.
locale-gen en_US.UTF-8: # Locale must exist
cmd.run:
- unless: locale -a | grep -q en_US.utf8
en_US.UTF-8:
locale.system:
- require:
- cmd: locale-gen en_US.UTF-8
postgresql:
pkg.installed:
- names:
- postgresql-9.1
- postgresql-contrib-9.1
- env:
LC_ALL: en_US.UTF-8 # NOTE! No - and two more spaces here.
- require:
- locale: en_US.UTF-8
/etc/postgresql/9.1/main:
file.directory:
- user: postgres
- group: postgres
- dir_mode: 755
- makedirs: true
- require:
- pkg: postgresql
postgres-hba-conf:
file.managed:
- name: /etc/postgresql/9.1/main/pg_hba.conf
- source: salt://postgresql/pg_hba.conf
- user: postgres
- group: postgres
- require:
- file: /etc/postgresql/9.1/main
postgres-conf:
file.managed:
- name: /etc/postgresql/9.1/main/postgresql.conf
- source: salt://postgresql/postgresql.conf
- group: postgres
- require:
- file: /etc/postgresql/9.1/main
postgresql-service:
service.running:
- name: postgresql
- enable: True
- require:
- pkg: postgresql
- watch:
- file: postgres-conf
- file: postgres-hba-conf
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
local all all ident
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
data_directory = '/var/lib/postgresql/9.1/main' # use data in another directory
hba_file = '/etc/postgresql/9.1/main/pg_hba.conf' # host-based authentication file
ident_file = '/etc/postgresql/9.1/main/pg_ident.conf' # ident configuration file
external_pid_file = '/var/run/postgresql/9.1-main.pid' # write an extra PID file
shared_buffers = 24MB
log_line_prefix = '%t ' # special values:
# These settings are initialized by initdb, but they can be changed.
lc_messages = 'en_US.UTF-8' # locale for system error message
# strings
lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
lc_numeric = 'en_US.UTF-8' # locale for number formatting
lc_time = 'en_US.UTF-8' # locale for time formatting
# default configuration for text search
default_text_search_config = 'pg_catalog.english'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment