mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-26 15:55:56 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
38
roles/pgadmin4/templates/config_local.py.j2
Normal file
38
roles/pgadmin4/templates/config_local.py.j2
Normal file
@@ -0,0 +1,38 @@
|
||||
SERVER_MODE={{ (pga_auth | length >= 1) | ternary('True','False') }}
|
||||
DEFAULT_SERVER='0.0.0.0'
|
||||
DEFAULT_SERVER_PORT={{ pga_port }}
|
||||
DATA_DIR='{{ pga_root_dir }}/data'
|
||||
LOG_FILE='{{ pga_root_dir }}/logs/pgadmin4.log'
|
||||
STORAGE_DIR='{{ pga_root_dir }}/data'
|
||||
SQLITE_PATH='{{ pga_root_dir }}/data/pgadmin4.db'
|
||||
SECURITY_EMAIL_SENDER='pgadmin4@{{ ansible_domain }}'
|
||||
SESSION_DB_PATH='{{ pga_root_dir }}/sessions'
|
||||
CONSOLE_LOG_FORMAT='%(levelname)s\t%(name)s:\t%(message)s'
|
||||
SHOW_GRAVATAR_IMAGE=False
|
||||
SECURITY_EMAIL_SENDER='no-reply@{{ ansible_domain }}'
|
||||
UPGRADE_CHECK_ENABLED=False
|
||||
DEFAULT_BINARY_PATHS = {
|
||||
"pg": "/usr/pgsql-14/bin/"
|
||||
}
|
||||
{% if pga_auth | length >= 1 %}
|
||||
AUTHENTICATION_SOURCES=['{{ pga_auth | join('\',\'') }}']
|
||||
{% endif %}
|
||||
{% if 'oauth2' in pga_auth %}
|
||||
OAUTH2_CONFIG=[{
|
||||
'OAUTH2_NAME': 'oidc',
|
||||
'OAUTH2_DISPLAY_NAME': '{{ pga_oidc_display_name }}',
|
||||
'OAUTH2_CLIENT_ID': '{{ pga_oidc_client_id }}',
|
||||
'OAUTH2_CLIENT_SECRET': '{{ pga_oidc_client_secret }}',
|
||||
'OAUTH2_API_BASE_URL': '{{ pga_oidc_base_url }}',
|
||||
'OAUTH2_TOKEN_URL': '{{ pga_oidc_token_url }}',
|
||||
'OAUTH2_AUTHORIZATION_URL': '{{ pga_oidc_auth_url }}',
|
||||
'OAUTH2_USERINFO_ENDPOINT': '{{ pga_oidc_userinfo_url }}',
|
||||
'OAUTH2_SCOPE': '{{ pga_oidc_scope }}',
|
||||
'OAUTH2_AUTO_CREATE_USER': True
|
||||
}]
|
||||
{% endif %}
|
||||
{% if 'webserver' in pga_auth %}
|
||||
WEBSERVER_AUTO_CREATE_USER=True
|
||||
WEBSERVER_REMOTE_USER='{{ pga_webserver_header }}'
|
||||
{% endif %}
|
||||
|
8
roles/pgadmin4/templates/logrotate.conf.j2
Normal file
8
roles/pgadmin4/templates/logrotate.conf.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ pga_root_dir }}/logs/*.log {
|
||||
daily
|
||||
rotate 180
|
||||
compress
|
||||
notifempty
|
||||
missingok
|
||||
copytruncate
|
||||
}
|
25
roles/pgadmin4/templates/pgadmin4.service.j2
Normal file
25
roles/pgadmin4/templates/pgadmin4.service.j2
Normal file
@@ -0,0 +1,25 @@
|
||||
[Unit]
|
||||
Description=pgAdmin4 server daemon
|
||||
After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pgadmin4_{{ pga_id }}
|
||||
Group=pgadmin4_{{ pga_id }}
|
||||
ExecStart={{ pga_root_dir }}/venv/bin/gunicorn --bind 0.0.0.0:{{ pga_port }} \
|
||||
--workers=1 \
|
||||
--threads=25 \
|
||||
--chdir {{ pga_root_dir }}/venv/lib/python3.6/site-packages/pgadmin4 \
|
||||
pgAdmin4:app
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
PrivateTmp=yes
|
||||
PrivateDevices=yes
|
||||
ProtectSystem=full
|
||||
ProtectHome=yes
|
||||
NoNewPrivileges=yes
|
||||
MemoryLimit=1024M
|
||||
SyslogIdentifier=pgadmin4_{{ pga_id }}
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
5
roles/pgadmin4/templates/post-backup.j2
Normal file
5
roles/pgadmin4/templates/post-backup.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
rm -f {{ pga_root_dir }}/backup/*
|
5
roles/pgadmin4/templates/pre-backup.j2
Normal file
5
roles/pgadmin4/templates/pre-backup.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
sqlite3 {{ pga_root_dir }}/data/pgadmin4.db .dump | zstd -c > {{ pga_root_dir }}/backup/pgadmin4.sql.zst
|
Reference in New Issue
Block a user