mirror of
				https://git.lapiole.org/dani/ansible-roles.git
				synced 2025-11-04 04:41:27 +01:00 
			
		
		
		
	Update to 2021-12-01 19:13
This commit is contained in:
		
							
								
								
									
										26
									
								
								roles/metabase/templates/env.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								roles/metabase/templates/env.j2
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
MB_ADMIN_EMAIL={{ metabase_admin_email }}
 | 
			
		||||
MB_EMAIL_FROM_ADDRESS={{ metabase_from_email }}
 | 
			
		||||
MB_EMAIL_SMTP_HOST={{metabase_smtp_server }}
 | 
			
		||||
MB_EMAIL_SMTP_PORT={{ metabase_smtp_port }}
 | 
			
		||||
{% if metabase_smtp_user is defined and metabase_smtp_pass is defined %}
 | 
			
		||||
MB_EMAIL_SMTP_USERNAME={{ metabase_smtp_user }}
 | 
			
		||||
MB_EMAIL_SMTP_PASSWORD={{ metabase_smtp_pass }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
MB_EMAIL_SMTP_SECURITY={{ metabase_smtp_starttls | ternary('starttls','none') }}
 | 
			
		||||
MB_ANON_TRACKING_ENABLED=false
 | 
			
		||||
MB_DB_DBNAME={{ metabase_db_name }}
 | 
			
		||||
MB_DB_HOST={{ metabase_db_server }}
 | 
			
		||||
MB_DB_USER={{ metabase_db_user }}
 | 
			
		||||
MB_DB_PASS={{ metabase_db_pass | quote }}
 | 
			
		||||
MB_DB_PORT={{ metabase_db_port }}
 | 
			
		||||
MB_DB_TYPE={{ metabase_db_engine }}
 | 
			
		||||
MB_ENCRYPTION_SECRET_KEY={{ metabase_encryption_key | quote }}
 | 
			
		||||
MB_JETTY_HOST=0.0.0.0
 | 
			
		||||
MB_JETTY_PORT={{ metabase_port }}
 | 
			
		||||
MB_PLUGINS_DIR={{ metabase_root_dir }}/plugins
 | 
			
		||||
MB_SITE_LOCALE={{ metabase_lang }}
 | 
			
		||||
MB_SITE_URL={{ metabase_public_url }}
 | 
			
		||||
MB_CHECK_FOR_UPDATES=false
 | 
			
		||||
MB_ENABLE_EMBEDDING=true
 | 
			
		||||
MB_ENABLE_PUBLIC_SHARING=true
 | 
			
		||||
MB_ENABLE_QUERY_CACHING={{ metabase_enable_cache | ternary('true', 'false') }}
 | 
			
		||||
							
								
								
									
										26
									
								
								roles/metabase/templates/metabase.service.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								roles/metabase/templates/metabase.service.j2
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=Metabase opensource BI
 | 
			
		||||
After=syslog.target network.target
 | 
			
		||||
 | 
			
		||||
[Service]
 | 
			
		||||
Type=simple
 | 
			
		||||
User={{ metabase_user }}
 | 
			
		||||
WorkingDirectory={{ metabase_root_dir }}/app
 | 
			
		||||
EnvironmentFile={{ metabase_root_dir }}/etc/env
 | 
			
		||||
ExecStart=/usr/bin/java -Djava.net.preferIPv4Stack=true \
 | 
			
		||||
{% if system_proxy is defined and system_proxy != '' %}
 | 
			
		||||
            -Dhttp.proxyHost={{ system_proxy | urlsplit('hostname') }} -Dhttp.proxyPort={{ system_proxy | urlsplit('port') }} \
 | 
			
		||||
            -Dhttps.proxyHost={{ system_proxy | urlsplit('hostname') }} -Dhttps.proxyPort={{ system_proxy | urlsplit('port') }} \
 | 
			
		||||
{% endif %}
 | 
			
		||||
            -jar {{ metabase_root_dir }}/app/metabase.jar
 | 
			
		||||
SuccessExitStatus=143
 | 
			
		||||
PrivateTmp=yes
 | 
			
		||||
PrivateDevices=yes
 | 
			
		||||
ProtectSystem=full
 | 
			
		||||
ProtectHome=yes
 | 
			
		||||
NoNewPrivileges=yes
 | 
			
		||||
Restart=on-failure
 | 
			
		||||
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=multi-user.target
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								roles/metabase/templates/post-backup.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								roles/metabase/templates/post-backup.j2
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
#!/bin/bash -e
 | 
			
		||||
 | 
			
		||||
rm -f {{ metabase_root_dir }}/backup/*
 | 
			
		||||
							
								
								
									
										24
									
								
								roles/metabase/templates/pre-backup.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								roles/metabase/templates/pre-backup.j2
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
set -eo pipefail
 | 
			
		||||
 | 
			
		||||
{% if metabase_db_engine == 'mysql' %}
 | 
			
		||||
/usr/bin/mysqldump \
 | 
			
		||||
{% if metabase_db_server not in ['localhost','127.0.0.1'] %}
 | 
			
		||||
  --user={{ metabase_db_user | quote }} \
 | 
			
		||||
  --password={{ metabase_db_pass | quote }} \
 | 
			
		||||
  --host={{ metabase_db_server | quote }} \
 | 
			
		||||
  --port={{ metabase_db_port | quote }} \
 | 
			
		||||
{% endif %}
 | 
			
		||||
  --quick --single-transaction \
 | 
			
		||||
  --add-drop-table {{ metabase_db_name | quote }} | zstd -c > {{ metabase_root_dir }}/backup/{{ metabase_db_name }}.sql.zst
 | 
			
		||||
{% elif metabase_db_engine == 'postgres' %}
 | 
			
		||||
PGPASSWORD={{ metabase_db_pass | quote }} /usr/pgsql-14/bin/pg_dump \
 | 
			
		||||
  --clean \
 | 
			
		||||
  --create \
 | 
			
		||||
  --username={{ metabase_db_user }} \
 | 
			
		||||
  --host={{ metabase_db_server }} \
 | 
			
		||||
  {{ metabase_db_name }} | zstd -c > {{ metabase_root_dir }}/backup/{{ metabase_db_name }}.sql.zst
 | 
			
		||||
{% endif %}
 | 
			
		||||
cp {{ metabase_root_dir }}/etc/env {{ metabase_root_dir }}/backup/
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user