[add] role:postgresql-for-authelia

This commit is contained in:
Christian Fraß 2024-03-19 18:45:32 +01:00
parent 944f75de59
commit b658f3057c
3 changed files with 39 additions and 10 deletions

View file

@ -0,0 +1,7 @@
{
"var_postgresql_for_authelia_host": "localhost",
"var_postgresql_for_authelia_port": 5432,
"var_postgresql_for_authelia_username": "authelia_user",
"var_postgresql_for_authelia_password": "REPLACE_ME",
"var_postgresql_for_authelia_schema": "authelia"
}

View file

@ -1,6 +1,6 @@
[ [
{ {
"name": "database:postgresql | packages", "name": "packages",
"become": true, "become": true,
"ansible.builtin.apt": { "ansible.builtin.apt": {
"pkg": [ "pkg": [
@ -10,34 +10,34 @@
} }
}, },
{ {
"name": "database:postgresql | user", "name": "user",
"become": true, "become": true,
"become_user": "postgres", "become_user": "postgres",
"community.postgresql.postgresql_user": { "community.postgresql.postgresql_user": {
"state": "present", "state": "present",
"name": "{{var_authelia_storage_data_postgresql_username}}", "name": "{{var_postgresql_for_authelia_username}}",
"password": "{{var_authelia_storage_data_postgresql_password}}" "password": "{{var_postgresql_for_authelia_password}}"
} }
}, },
{ {
"name": "database:postgresql | schema", "name": "schema",
"become": true, "become": true,
"become_user": "postgres", "become_user": "postgres",
"community.postgresql.postgresql_db": { "community.postgresql.postgresql_db": {
"state": "present", "state": "present",
"name": "{{var_authelia_storage_data_postgresql_schema}}", "name": "{{var_postgresql_for_authelia_schema}}",
"owner": "{{var_authelia_storage_data_postgresql_username}}" "owner": "{{var_postgresql_for_authelia_username}}"
} }
}, },
{ {
"name": "database:postgresql | rights", "name": "rights",
"become": true, "become": true,
"become_user": "postgres", "become_user": "postgres",
"community.postgresql.postgresql_privs": { "community.postgresql.postgresql_privs": {
"state": "present", "state": "present",
"db": "{{var_authelia_storage_data_postgresql_schema}}", "db": "{{var_postgresql_for_authelia_schema}}",
"objs": "ALL_IN_SCHEMA", "objs": "ALL_IN_SCHEMA",
"roles": "{{var_authelia_storage_data_postgresql_username}}", "roles": "{{var_postgresql_for_authelia_username}}",
"privs": "ALL", "privs": "ALL",
"grant_option": true "grant_option": true
} }

View file

@ -0,0 +1,22 @@
{
"host": {
"mandatory": false,
"type": "string"
},
"port": {
"mandatory": false,
"type": "integer"
},
"username": {
"mandatory": false,
"type": "string"
},
"password": {
"mandatory": true,
"type": "string"
},
"schema": {
"mandatory": false,
"type": "string"
}
}