[add] role:postgresql-for-hedgedoc
This commit is contained in:
parent
e81cbdcedf
commit
bf4afbdc7a
2 changed files with 50 additions and 0 deletions
5
ansible/roles/postgresql-for-hedgedoc/defaults/main.json
Normal file
5
ansible/roles/postgresql-for-hedgedoc/defaults/main.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"var_postgresql_for_hedgedoc_username": "hedgedoc_user",
|
||||
"var_postgresql_for_hedgedoc_password": "REPLACE_ME",
|
||||
"var_postgresql_for_hedgedoc_schema": "hedgedoc"
|
||||
}
|
45
ansible/roles/postgresql-for-hedgedoc/tasks/main.json
Normal file
45
ansible/roles/postgresql-for-hedgedoc/tasks/main.json
Normal file
|
@ -0,0 +1,45 @@
|
|||
[
|
||||
{
|
||||
"name": "packages",
|
||||
"become": true,
|
||||
"ansible.builtin.apt": {
|
||||
"pkg": [
|
||||
"acl",
|
||||
"python3-psycopg2"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "user",
|
||||
"become": true,
|
||||
"become_user": "postgres",
|
||||
"community.postgresql.postgresql_user": {
|
||||
"state": "present",
|
||||
"name": "{{var_postgresql_for_hedgedoc_username}}",
|
||||
"password": "{{var_postgresql_for_hedgedoc_password}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "schema",
|
||||
"become": true,
|
||||
"become_user": "postgres",
|
||||
"community.postgresql.postgresql_db": {
|
||||
"state": "present",
|
||||
"name": "{{var_postgresql_for_hedgedoc_schema}}",
|
||||
"owner": "{{var_postgresql_for_hedgedoc_username}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rights",
|
||||
"become": true,
|
||||
"become_user": "postgres",
|
||||
"community.postgresql.postgresql_privs": {
|
||||
"state": "present",
|
||||
"db": "{{var_postgresql_for_hedgedoc_schema}}",
|
||||
"objs": "ALL_IN_SCHEMA",
|
||||
"roles": "{{var_postgresql_for_hedgedoc_username}}",
|
||||
"privs": "ALL",
|
||||
"grant_option": true
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Add table
Reference in a new issue