oidc-parent/deployment/roles/hydra_database/tasks/main.yml
Jan Dittberner 00c0d3de1a Create basic local playbook and roles
- create ansible structure
- create generated roles
- add hydra_database role
2022-08-10 20:35:03 +02:00

29 lines
749 B
YAML

---
- 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