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

38 lines
999 B
YAML
Raw Permalink 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 }}"
2023-08-07 16:41:29 +00:00
privs: CONNECT
type: database
role: "{{ hydra_db_user }}"
become_user: postgres
2023-08-07 16:41:29 +00:00
- name: Grant permissions on public schema of Hydra database to Hydra database user
community.postgresql.postgresql_privs:
database: "{{ hydra_db_name }}"
objs: public
privs: CREATE,USAGE
type: schema
role: "{{ hydra_db_user }}"
become_user: postgres