oidc-parent/deployment/roles/hydra_database/tasks/main.yml

30 lines
749 B
YAML
Raw Normal View History

---
- name: Install PostgreSQL server
ansible.builtin.package:
name: postgresql
state: present
- name: Create Hydra database
community.postgresql.postgresql_db:
name: "{{ hydra_db_name }}"
encoding: UTF-8
template: template0
state: present
become_user: postgres
- name: Create Hydra database user
community.postgresql.postgresql_user:
name: "{{ hydra_db_user }}"
password: "{{ hydra_db_password }}"
state: present
become_user: postgres
- name: Grant permissions on Hydra database to Hydra database user
community.postgresql.postgresql_privs:
database: "{{ hydra_db_name }}"
state: present
privs: CREATE,CONNECT
type: database
role: "{{ hydra_db_user }}"
become_user: postgres