aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles/postgres/tasks/main.yml
diff options
context:
space:
mode:
authorSimen Linderud <simen.linderud@gmail.com>2019-01-19 19:26:41 +0100
committerGitHub <noreply@github.com>2019-01-19 19:26:41 +0100
commit54419582734d0fb820c8c08a7847eb6961f481c5 (patch)
treed1a22a24322d2a26dcddb79347fab4061be49eac /ansible/roles/postgres/tasks/main.yml
parentf11803f365ec8729d3056642468e975c3cf8a85b (diff)
parentbb1cc93d51efcd24d77b51187638e9616c061ed6 (diff)
Merge pull request #194 from lasseh/master
Update ansible play for Debian 9
Diffstat (limited to 'ansible/roles/postgres/tasks/main.yml')
-rw-r--r--ansible/roles/postgres/tasks/main.yml16
1 files changed, 3 insertions, 13 deletions
diff --git a/ansible/roles/postgres/tasks/main.yml b/ansible/roles/postgres/tasks/main.yml
index 6283a75..902eeb9 100644
--- a/ansible/roles/postgres/tasks/main.yml
+++ b/ansible/roles/postgres/tasks/main.yml
@@ -1,17 +1,13 @@
-# Postgres
+# Postgres
# https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
#
- name: Install db-packages
apt:
- name: "{{ item }}"
+ name: ['postgresql', 'python-psycopg2', 'sudo']
state: present
- with_items:
- - postgresql-9.4
- - python-psycopg2
- - sudo
- name: Drop postgresql-config
copy:
- dest: /etc/postgresql/9.4/main/postgresql.conf
+ dest: /etc/postgresql/9.6/main/postgresql.conf
src: postgresql.conf
- name: Add db to hosts
lineinfile:
@@ -28,29 +24,23 @@
state: present
line: "{{ whoami.stdout }} ALL=(postgres) NOPASSWD: ALL"
- name: Make postgres-db
- become_user: postgres
postgresql_db:
name: nms
- # https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
become: true
become_user: postgres
vars:
ansible_ssh_pipelining: true
- name: Ensure a valid postgres-user
- become_user: postgres
postgresql_user:
db: nms
name: nms
password: risbrod
- # https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
become: true
become_user: postgres
vars:
ansible_ssh_pipelining: true
- name: Import SQL
- become_user: postgres
shell: psql nms < /opt/gondul/ansible/roles/postgres/files/schema.sql
- # https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
become: true
become_user: postgres
vars: