2024-10-02 23:56:33 +02:00
|
|
|
---
|
2024-10-08 00:03:23 +02:00
|
|
|
- name: Create pretix postges user
|
|
|
|
become: true
|
|
|
|
become_user: postgres
|
|
|
|
become_method: community.general.sudosu
|
|
|
|
community.postgresql.postgresql_user:
|
|
|
|
name: "{{ postgres__user }}"
|
2024-10-08 01:51:38 +02:00
|
|
|
password: "{{ postgres__password }}"
|
|
|
|
encrypted: true
|
2024-10-08 00:03:23 +02:00
|
|
|
|
|
|
|
- name: Create pretix database
|
|
|
|
become: true
|
|
|
|
become_user: postgres
|
|
|
|
become_method: community.general.sudosu
|
|
|
|
community.postgresql.postgresql_db:
|
|
|
|
name: "{{ postgres__database }}"
|
|
|
|
encoding: 'UTF-8'
|
|
|
|
lc_collate: 'de_DE.UTF-8'
|
|
|
|
lc_ctype: 'de_DE.UTF-8'
|
|
|
|
locale_provider: 'icu'
|
|
|
|
icu_locale: 'de-DE-x-icu'
|
|
|
|
template: 'template0'
|
|
|
|
|
|
|
|
- name: Make sure pretix database is owned by right user
|
|
|
|
become: true
|
|
|
|
become_user: postgres
|
|
|
|
become_method: community.general.sudosu
|
|
|
|
community.postgresql.postgresql_user:
|
|
|
|
name: "{{ postgres__user }}"
|
|
|
|
db: "{{ postgres__database }}"
|
2024-10-08 01:51:38 +02:00
|
|
|
password: "{{ postgres__password }}"
|
|
|
|
encrypted: true
|
2024-10-09 02:16:11 +02:00
|
|
|
|
|
|
|
- name: Grant ALL privileges on public schema to pretix database user
|
|
|
|
become: true
|
|
|
|
become_user: postgres
|
|
|
|
become_method: community.general.sudosu
|
|
|
|
community.postgresql.postgresql_privs:
|
|
|
|
database: "{{ postgres__database }}"
|
|
|
|
roles: "{{ postgres__user }}"
|
|
|
|
privs: 'ALL'
|
|
|
|
type: 'schema'
|
|
|
|
objs: 'public'
|
|
|
|
state: 'present'
|
|
|
|
|
|
|
|
- name: Ensure the user can create tables and objects in the public schema
|
|
|
|
become: true
|
|
|
|
become_user: postgres
|
|
|
|
become_method: community.general.sudosu
|
|
|
|
community.postgresql.postgresql_privs:
|
|
|
|
database: "{{ postgres__database }}"
|
|
|
|
roles: "{{ postgres__user }}"
|
|
|
|
privs: "CREATE,USAGE"
|
|
|
|
type: 'schema'
|
|
|
|
objs: 'public'
|
|
|
|
state: 'present'
|
|
|
|
|
|
|
|
- name: Grant create privileges on the database for pretix user
|
|
|
|
become: true
|
|
|
|
become_user: postgres
|
|
|
|
become_method: community.general.sudosu
|
|
|
|
community.postgresql.postgresql_privs:
|
|
|
|
database: "{{ postgres__database }}"
|
|
|
|
roles: "{{ postgres__user }}"
|
|
|
|
privs: "CREATE"
|
|
|
|
type: 'database'
|
|
|
|
state: 'present'
|