Jan Dittberner
00c0d3de1a
- create ansible structure - create generated roles - add hydra_database role
29 lines
749 B
YAML
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
|