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:
11
roles/n8n/templates/env.j2
Normal file
11
roles/n8n/templates/env.j2
Normal file
@@ -0,0 +1,11 @@
|
||||
N8N_CONFIG_FILES={{ n8n_root_dir }}/etc/n8n.json
|
||||
N8N_USER_FOLDER={{ n8n_root_dir }}/data
|
||||
WEBHOOK_TUNNEL_URL={{ n8n_public_url }}
|
||||
VUE_APP_URL_BASE_API={{ n8n_public_url }}
|
||||
N8N_ENCRYPTION_KEY={{ n8n_secret_key | quote }}
|
||||
EXECUTIONS_DATA_PRUNE=true
|
||||
EXECUTIONS_DATA_MAX_AGE={{ n8n_data_max_age }}
|
||||
N8N_CUSTOM_EXTENSIONS={{ n8n_root_dir }}/.n8n/custom
|
||||
{% for env in n8n_env_var.keys() | list %}
|
||||
{{ env }}={{ n8n_env_var[env] }}
|
||||
{% endfor %}
|
1
roles/n8n/templates/n8n.json.j2
Normal file
1
roles/n8n/templates/n8n.json.j2
Normal file
@@ -0,0 +1 @@
|
||||
{{ n8n_config | to_nice_json(indent=4) }}
|
24
roles/n8n/templates/n8n.service.j2
Normal file
24
roles/n8n/templates/n8n.service.j2
Normal file
@@ -0,0 +1,24 @@
|
||||
[Unit]
|
||||
Description=n8n workflow automation daemon
|
||||
After=syslog.target network.target mariadb.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ n8n_user }}
|
||||
Group={{ n8n_user }}
|
||||
EnvironmentFile={{ n8n_root_dir }}/etc/env
|
||||
ExecStart={{ n8n_root_dir }}/app/node_modules/n8n/bin/n8n
|
||||
PrivateTmp=yes
|
||||
{% if n8n_protect_system %}
|
||||
ProtectSystem=full
|
||||
NoNewPrivileges=yes
|
||||
ProtectHome=yes
|
||||
{% endif %}
|
||||
MemoryLimit={{ n8n_mem_limit }}M
|
||||
Environment=NODE_OPTIONS="--max-old-space-size={{ n8n_mem_limit }}"
|
||||
Restart=on-failure
|
||||
StartLimitInterval=0
|
||||
RestartSec=30
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
3
roles/n8n/templates/post-backup.sh.j2
Normal file
3
roles/n8n/templates/post-backup.sh.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
rm -f {{ n8n_root_dir }}/backup/*.sql.zst
|
13
roles/n8n/templates/pre-backup.sh.j2
Normal file
13
roles/n8n/templates/pre-backup.sh.j2
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
/usr/bin/mysqldump \
|
||||
{% if n8n_db_server not in ['localhost','127.0.0.1'] %}
|
||||
--user={{ n8n_db_user | quote }} \
|
||||
--password={{ n8n_db_pass | quote }} \
|
||||
--host={{ n8n_db_server | quote }} \
|
||||
--port={{ n8n_db_port | quote }} \
|
||||
{% endif %}
|
||||
--quick --single-transaction \
|
||||
--add-drop-table {{ n8n_db_name | quote }} | zstd -c > {{ n8n_root_dir }}/backup/{{ n8n_db_name }}.sql.zst
|
Reference in New Issue
Block a user