Install python3-psycopg2 (required by Ansible)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
jeltz 2021-03-10 13:35:18 +01:00
parent 36b04239fd
commit 7a07155237

View file

@ -1,8 +1,10 @@
---
- name: Install postgresql
- name: Install postgresql and psycopg2
apt:
update_cache: true
name: postgresql
pkg:
- postgresql
- python3-psycopg2
state: present
register: apt_result
retries: 3
@ -39,11 +41,15 @@
- restart postgresql
- name: Create databases
become: true
become_user: postgres
postgresql_db:
name: "{{ item.name }}"
name: "{{ item }}"
loop: "{{ postgresql_databases }}"
- name: Create users
become: true
become_user: postgres
postgresql_user:
db: "{{ item.database }}"
name: "{{ item.name }}"