Skip to content

Commit

Permalink
chore: replaced deprecated privilege code (#497)
Browse files Browse the repository at this point in the history
* chore: replaced deprecated privilege code

* chore: replaced deprecated privs code for doorgeefluik

---------

Co-authored-by: Tobias de Bruijn <[email protected]>
  • Loading branch information
SilasPeters and TobiasDeBruijn authored Feb 11, 2025
1 parent 18afd5c commit b9f1d48
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
16 changes: 14 additions & 2 deletions ansible/roles/databases/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,20 @@
community.postgresql.postgresql_user:
db: "koala"
name: "koala"
priv: "ALL"
role_attr_flags: "CREATEDB,LOGIN"

- name: "ensure koala user has the right privs"
community.postgresql.postgresql_privs:
db: "koala"
role: "koala"
objs: "ALL_IN_SCHEMA"
privs: "ALL"

- name: "ensure dbeaver koala user exists"
community.postgresql.postgresql_user:
db: "koala"
name: "koala_manual"
password: "{{ secret_koala_manual.password }}"
priv: "CONNECT"
role_attr_flags: "NOSUPERUSER"

- name: "ensure dbeaver koala user has the right privs"
Expand All @@ -51,3 +56,10 @@
role: "koala_manual"
objs: "ALL_IN_SCHEMA"
privs: "SELECT"

- name: "ensure dbeaver koala user has the right privs"
community.postgresql.postgresql_privs:
db: "koala"
role: "koala_manual"
type: "database"
privs: "CONNECT"
7 changes: 4 additions & 3 deletions ansible/roles/doorgeefluik/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- name: "ensure database user exists"
community.postgresql.postgresql_user:
name: "doorgeefluik"
role_attr_flags: "CREATEDB,LOGIN"
become_user: "postgres"
become: true

Expand All @@ -34,11 +35,11 @@
become: true

- name: "ensure database user has the right privileges"
community.postgresql.postgresql_user:
community.postgresql.postgresql_privs:
db: "doorgeefluik"
name: "doorgeefluik"
role: "doorgeefluik"
objs: "ALL_IN_SCHEMA"
priv: "ALL"
role_attr_flags: "CREATEDB,LOGIN"
become_user: "postgres"
become: true
ignore_errors: "{{ ansible_check_mode }}"
Expand Down

0 comments on commit b9f1d48

Please sign in to comment.