mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-07-04 06:42:13 +02:00
Install PSQL and init DB
This commit is contained in:
27
ansible/roles/5-psql/tasks/main.yml
Normal file
27
ansible/roles/5-psql/tasks/main.yml
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Install PostgreSQL APT packages
|
||||
apt:
|
||||
update_cache: true
|
||||
name:
|
||||
- postgresql
|
||||
- postgresql-contrib
|
||||
- libpq-dev
|
||||
register: pkg_result
|
||||
retries: 3
|
||||
until: pkg_result is succeeded
|
||||
|
||||
- name: Install Psycopg2
|
||||
pip:
|
||||
name: psycopg2-binary
|
||||
|
||||
- name: Create role note
|
||||
postgresql_user:
|
||||
name: note
|
||||
password: note # Fix it!
|
||||
become_user: postgres
|
||||
|
||||
- name: Create NK20 database
|
||||
postgresql_db:
|
||||
name: note_db
|
||||
owner: note
|
||||
become_user: postgres
|
Reference in New Issue
Block a user