[add] postgresql-for-tandoor
This commit is contained in:
parent
45cd387e99
commit
5b9545010a
2 changed files with 55 additions and 0 deletions
5
roles/postgresql-for-tandoor/defaults/main.json
Normal file
5
roles/postgresql-for-tandoor/defaults/main.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"var_postgresql_for_tandoor_username": "tandoor_user",
|
||||||
|
"var_postgresql_for_tandoor_password": "REPLACE_ME",
|
||||||
|
"var_postgresql_for_tandoor_schema": "tandoor"
|
||||||
|
}
|
50
roles/postgresql-for-tandoor/tasks/main.json
Normal file
50
roles/postgresql-for-tandoor/tasks/main.json
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "packages",
|
||||||
|
"become": true,
|
||||||
|
"ansible.builtin.apt": {
|
||||||
|
"update_cache": true,
|
||||||
|
"pkg": [
|
||||||
|
"acl",
|
||||||
|
"python3-psycopg2",
|
||||||
|
"libpq-dev"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "user",
|
||||||
|
"become": true,
|
||||||
|
"become_user": "tandoor",
|
||||||
|
"community.tandoorql.tandoorql_user": {
|
||||||
|
"state": "present",
|
||||||
|
"name": "{{var_postgresql_for_tandoor_username}}",
|
||||||
|
"password": "{{var_postgresql_for_tandoor_password}}"
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"PGOPTIONS": "-c password_encryption=scram-sha-256"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "schema",
|
||||||
|
"become": true,
|
||||||
|
"become_user": "tandoor",
|
||||||
|
"community.tandoorql.tandoorql_db": {
|
||||||
|
"state": "present",
|
||||||
|
"name": "{{var_postgresql_for_tandoor_schema}}",
|
||||||
|
"owner": "{{var_postgresql_for_tandoor_username}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rights",
|
||||||
|
"become": true,
|
||||||
|
"become_user": "tandoor",
|
||||||
|
"community.tandoorql.tandoorql_privs": {
|
||||||
|
"state": "present",
|
||||||
|
"db": "{{var_postgresql_for_tandoor_schema}}",
|
||||||
|
"objs": "ALL_IN_SCHEMA",
|
||||||
|
"roles": "{{var_postgresql_for_tandoor_username}}",
|
||||||
|
"privs": "ALL",
|
||||||
|
"grant_option": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
Loading…
Add table
Reference in a new issue