mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 00:05:44 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
15
roles/documize/templates/documize.conf.j2
Normal file
15
roles/documize/templates/documize.conf.j2
Normal file
@@ -0,0 +1,15 @@
|
||||
[http]
|
||||
port = {{ documize_port }}
|
||||
|
||||
[database]
|
||||
{% if documize_db_engine == 'mysql' %}
|
||||
type = "mysql"
|
||||
connection = "{{ documize_db_user }}:{{ documize_db_pass }}@tcp({{ documize_db_server }}:{{ documize_db_port }})/{{ documize_db_name }}"
|
||||
{% elif documize_db_engine == 'postgres' %}
|
||||
type = "postgresql"
|
||||
connection = "host={{ documize_db_server }} port={{ documize_db_port }} dbname={{ documize_db_name }} user={{ documize_db_user }} password={{ documize_db_pass }} sslmode=disable"
|
||||
{% endif %}
|
||||
salt = "{{ documize_salt }}"
|
||||
|
||||
[install]
|
||||
location = "selfhost"
|
24
roles/documize/templates/documize.service.j2
Normal file
24
roles/documize/templates/documize.service.j2
Normal file
@@ -0,0 +1,24 @@
|
||||
[Unit]
|
||||
Description=Documize Documentation Manager
|
||||
After=network.target postgresql.service mariadb.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ documize_user }}
|
||||
ExecStart={{ documize_root_dir }}/bin/documize {{ documize_root_dir }}/etc/documize.conf
|
||||
WorkingDirectory={{ documize_root_dir }}/tmp
|
||||
Restart=always
|
||||
NoNewPrivileges=true
|
||||
PrivateDevices=true
|
||||
ProtectControlGroups=true
|
||||
ProtectHome=true
|
||||
ProtectKernelModules=true
|
||||
ProtectKernelTunables=true
|
||||
ProtectSystem=strict
|
||||
RestrictRealtime=true
|
||||
ReadWritePaths=/run
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
3
roles/documize/templates/post-backup.j2
Normal file
3
roles/documize/templates/post-backup.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
rm -f {{ documize_root_dir }}/backup/*
|
26
roles/documize/templates/pre-backup.j2
Normal file
26
roles/documize/templates/pre-backup.j2
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
{% if documize_db_engine == 'mysql' %}
|
||||
/usr/bin/mysqldump \
|
||||
{% if documize_db_server not in ['127.0.0.1','localhost'] %}
|
||||
--user={{ documize_db_user | quote }} \
|
||||
--password={{ documize_db_pass | quote }} \
|
||||
--host={{ documize_db_server | quote }} \
|
||||
{% endif %}
|
||||
--quick --single-transaction \
|
||||
--add-drop-table {{ documize_db_name | quote }} | zstd -c > "{{ documize_root_dir }}/backup/{{ documize_db_name }}.sql.zst"
|
||||
{% elif documize_db_engine == 'postgres' %}
|
||||
{% if documize_db_server not in ['127.0.0.1','localhost'] %}
|
||||
PGPASSWORD={{ documize_db_pass | quote }} /usr/pgsql-14/bin/pg_dump \
|
||||
--clean \
|
||||
--create \
|
||||
--username={{ documize_db_user | quote }} \
|
||||
--host={{ documize_db_server | quote }} \
|
||||
{{ documize_db_name | quote }} | \
|
||||
{% else %}
|
||||
su - postgres -c "/usr/pgsql-14/bin/pg_dump --clean --create {{ documize_db_name | quote }}" | \
|
||||
{% endif %}
|
||||
zstd -c > "{{ documize_root_dir }}/backup/{{ documize_db_name }}.sql.zst"
|
||||
{% endif %}
|
Reference in New Issue
Block a user