Skip to content

Commit

Permalink
manage pg_hba.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
emillon committed Oct 27, 2014
1 parent b08e4b1 commit d9b78a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions devops/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@
sudo_user: postgres
postgresql_user: name={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB

- name: configure postgres auth
action: template
args:
src: templates/pg_hba.conf
dest: /etc/postgresql/9.4/main/pg_hba.conf
notify:
- restart postgres

- name: run DB migrations
action: command env VIRTUAL_ENV={{webapps_dir}}/{{app_name}}/venv {{webapps_dir}}/{{app_name}}/venv/bin/python {{webapps_dir}}/{{app_name}}/src/manage.py db upgrade
args:
Expand Down Expand Up @@ -108,3 +116,6 @@

- name: restart nginx
action: service name=nginx state=restarted

- name: restart postgres
action: service name=postgresql state=restarted
8 changes: 8 additions & 0 deletions devops/templates/pg_hba.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Database administrative login by Unix domain socket
local all postgres peer

# TYPE DATABASE USER ADDRESS METHOD
local {{dbname}} {{dbuser}} trust

# "local" is for Unix domain socket connections only
local all all peer

0 comments on commit d9b78a3

Please sign in to comment.