Compare commits

..

No commits in common. "3eab5611fdfb5143ce4af52194dfe5a06cb34c44" and "6f36c11791960c121f0db4a6fd50965b95cb2c49" have entirely different histories.

6 changed files with 0 additions and 177 deletions

View file

@ -1,7 +0,0 @@
{
"var_postgresql_for_zeitbild_username": "zeitbild_user",
"var_postgresql_for_zeitbild_password": "REPLACE_ME",
"var_postgresql_for_zeitbild_schema": "zeitbild",
"var_postgresql_for_zeitbild_git_reference": "master",
"var_postgresql_for_zeitbild_revision": "."
}

View file

@ -1,85 +0,0 @@
[
{
"name": "packages",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"acl",
"python3-psycopg2"
]
}
},
{
"name": "user",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_user": {
"state": "present",
"name": "{{var_postgresql_for_zeitbild_username}}",
"password": "{{var_postgresql_for_zeitbild_password}}"
},
"environment": {
"PGOPTIONS": "-c password_encryption=scram-sha-256"
}
},
{
"name": "schema",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_db": {
"state": "present",
"name": "{{var_postgresql_for_zeitbild_schema}}",
"owner": "{{var_postgresql_for_zeitbild_username}}"
}
},
{
"name": "rights",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_privs": {
"state": "present",
"db": "{{var_postgresql_for_zeitbild_schema}}",
"objs": "ALL_IN_SCHEMA",
"roles": "{{var_postgresql_for_zeitbild_username}}",
"privs": "ALL",
"grant_option": true
}
},
{
"name": "structure | fetch",
"delegate_to": "localhost",
"ansible.builtin.git": {
"repo": "https://forgejo.linke.sx/zeitbild/datamodel",
"version": "{{var_postgresql_for_zeitbild_git_reference}}",
"dest": "/tmp/zeitbild-datamodel-repo"
}
},
{
"name": "structure | build",
"delegate_to": "localhost",
"ansible.builtin.shell": {
"chdir": "/tmp/zeitbild-datamodel-repo",
"cmd": "tools/build --revision='{{var_postgresql_for_zeitbild_revision}}' --format='postgresql' > /tmp/zeitbild.sql"
}
},
{
"name": "structure | transfer",
"ansible.builtin.copy": {
"src": "/tmp/zeitbild.sql",
"dest": "/tmp/zeitbild.sql"
}
},
{
"name": "structure | apply",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_query": {
"db": "{{var_postgresql_for_zeitbild_schema}}",
"login_host": "localhost",
"login_user": "{{var_postgresql_for_zeitbild_username}}",
"login_password": "{{var_postgresql_for_zeitbild_password}}",
"query": "{{lookup('ansible.builtin.file','/tmp/zeitbild.sql')}}"
}
}
]

View file

@ -1,18 +0,0 @@
{
"username": {
"type": "string",
"mandatory": false
},
"password": {
"type": "string",
"mandatory": true
},
"schema": {
"type": "string",
"mandatory": false
},
"git_reference": {
"type": "string",
"mandatory": false
}
}

View file

@ -1,5 +0,0 @@
{
"var_zeitbild_backend_and_nginx_domain": "zeitbild.example.org",
"var_zeitbild_backend_and_nginx_port": 7845,
"var_zeitbild_backend_and_nginx_tls": true
}

View file

@ -1,35 +0,0 @@
[
{
"name": "deactivate default site",
"become": true,
"ansible.builtin.file": {
"state": "absent",
"dest": "/etc/nginx/sites-enabled/default"
}
},
{
"name": "emplace configuration | data",
"become": true,
"ansible.builtin.template": {
"src": "conf.j2",
"dest": "/etc/nginx/sites-available/{{var_zeitbild_backend_and_nginx_domain}}"
}
},
{
"name": "emplace configuration | link",
"become": true,
"ansible.builtin.file": {
"state": "link",
"src": "/etc/nginx/sites-available/{{var_zeitbild_backend_and_nginx_domain}}",
"dest": "/etc/nginx/sites-enabled/{{var_zeitbild_backend_and_nginx_domain}}"
}
},
{
"name": "restart nginx",
"become": true,
"ansible.builtin.systemd_service": {
"state": "restarted",
"name": "nginx"
}
}
]

View file

@ -1,27 +0,0 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
server_name {{var_zeitbild_backend_and_nginx_domain}};
listen 80;
listen [::]:80;
{% if var_zeitbild_backend_and_nginx_tls %}
listen [::]:443 ssl http2;
listen 443 ssl http2;
ssl_certificate /etc/ssl/certs/{{var_zeitbild_backend_and_nginx_domain}}.pem;
ssl_certificate_key /etc/ssl/private/{{var_zeitbild_backend_and_nginx_domain}}.pem;
include /etc/nginx/ssl-hardening.conf;
{% endif %}
location / {
proxy_pass http://localhost:{{var_zeitbild_backend_and_nginx_port | string}};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}