metabase-service

Description

This only installs the application and systemd unit, it does not configure the service in any way. If you want everything installed ready to go, use the 'metabase-standalone' frecklet.

Variables

Name Type Default Description

metabase_db_file

string --

The path to the database file, in case of h2.

metabase_db_host

string localhost

The database host.

metabase_db_name

string metabase

The name of the database.

metabase_db_password

string --

The database password.

metabase_db_port

integer --

The database port.

metabase_db_type

string h2

Database type to connect to.

metabase_db_user

string metabase

The database user.

metabase_host

string localhost

The hostname to listen on.

metabase_port

integer 3000

The port for metabase to listen on.

metabase_version

string 0.31.2

The version of metabase.

password_complexity

string normal

Allowed password complexity (weak|normal|strong).

password_length

integer 8

Minimal password length.

Code

doc:
  short_help: Install the Metabase service.
  help: |
    This only installs the application and systemd unit, it does not configure the service in any way.
    If you want everything installed ready to go, use the 'metabase-standalone' frecklet.
args:
  _import: metabase-service-configuration-file
  metabase_version:
    doc:
      short_help: The version of metabase.
    default: 0.31.2
    type: string
  metabase_port:
    doc:
      short_help: The port for metabase to listen on.
    type: integer
    required: false
    default: 3000
  metabase_host:
    doc:
      short_help: The hostname to listen on.
    type: string
    required: false
    default: localhost

frecklets:
- java-lang-installed
- file-downloaded:
    url: 'http://downloads.metabase.com/v{{:: metabase_version ::}}/metabase.jar'
    dest: /var/lib/metabase/metabase.jar
    owner: metabase
    group: metabase
- metabase-service-configuration-file:
    path: /etc/metabase.env
    owner: metabase
    group: metabase
    mode: '0600'
    jetty_port: '{{:: metabase_port ::}}'
    jetty_host: '{{:: metabase_host ::}}'
    metabase_db_type: '{{:: metabase_db_type ::}}'
    metabase_db_host: '{{:: metabase_db_host ::}}'
    metabase_db_port: '{{:: metabase_db_port ::}}'
    metabase_db_name: '{{:: metabase_db_name ::}}'
    metabase_db_user: '{{:: metabase_db_user ::}}'
    metabase_db_password: '{{:: metabase_db_password ::}}'
    metabase_db_file: '{{:: metabase_db_file ::}}'
    password_complexity: '{{:: password_complexity ::}}'
    password_length: '{{:: password_length ::}}'
- systemd-service-unit:
    name: metabase
    desc: metabase business intelligence service
    service_type: simple
    service_working_directory: /var/lib/metabase
    service_exec_start: /usr/bin/java -Xms128m -Xmx256m -jar metabase.jar
    service_user: metabase
    service_restart: on-failure
    service_restart_sec: 10
    service_environment_file: /etc/metabase.env
    install_wanted_by:
    - multi-user.target
    enabled: true
    started: true
frecklecute --community metabase-service --help

Usage: frecklecute metabase-service [OPTIONS]

  This only installs the application and systemd unit, it does not configure
  the service in any way. If you want everything installed ready to go, use
  the 'metabase-standalone' frecklet.

Options:
  --metabase-db-file METABASE_DB_FILE
                                  The path to the database file, in case of
                                  h2.
  --metabase-db-host METABASE_DB_HOST
                                  The database host.
  --metabase-db-name METABASE_DB_NAME
                                  The name of the database.
  --metabase-db-password METABASE_DB_PASSWORD
                                  The database password.
  --metabase-db-port METABASE_DB_PORT
                                  The database port.
  --metabase-db-type METABASE_DB_TYPE
                                  Database type to connect to.
  --metabase-db-user METABASE_DB_USER
                                  The database user.
  --metabase-host METABASE_HOST   The hostname to listen on.
  --metabase-port METABASE_PORT   The port for metabase to listen on.
  --metabase-version METABASE_VERSION
                                  The version of metabase.
  --password-complexity PASSWORD_COMPLEXITY
                                  Allowed password complexity
                                  (weak|normal|strong).
  --password-length PASSWORD_LENGTH
                                  Minimal password length.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.metabase_service.MetabaseService
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class MetabaseService(AutoPycklet):
    """This only installs the application and systemd unit, it does not configure the service in any way.
     If you want everything installed ready to go, use the 'metabase-standalone' frecklet.

       Args:
         metabase_db_file: The path to the database file, in case of h2.
         metabase_db_host: The database host.
         metabase_db_name: The name of the database.
         metabase_db_password: The database password.
         metabase_db_port: The database port.
         metabase_db_type: Database type to connect to.
         metabase_db_user: The database user.
         metabase_host: The hostname to listen on.
         metabase_port: The port for metabase to listen on.
         metabase_version: The version of metabase.
         password_complexity: Allowed password complexity (weak|normal|strong).
         password_length: Minimal password length.

    """

    FRECKLET_ID = "metabase-service"

    metabase_db_file: str = None
    metabase_db_host: str = None
    metabase_db_name: str = None
    metabase_db_password: str = None
    metabase_db_port: int = None
    metabase_db_type: str = None
    metabase_db_user: str = None
    metabase_host: str = None
    metabase_port: int = None
    metabase_version: str = None
    password_complexity: str = None
    password_length: int = None


    def __post_init__(self):
        super(MetabaseService, self).__init__(var_names=["metabase_db_file", "metabase_db_host", "metabase_db_name", "metabase_db_password", "metabase_db_port", "metabase_db_type", "metabase_db_user", "metabase_host", "metabase_port", "metabase_version", "password_complexity", "password_length"])


frecklet_class = MetabaseService
# -*- coding: utf-8 -*-


#
# module path: pycklets.metabase_service.MetabaseService
#


from pyckles import AutoPycklet

class MetabaseService(AutoPycklet):
    """This only installs the application and systemd unit, it does not configure the service in any way.
     If you want everything installed ready to go, use the 'metabase-standalone' frecklet.

       Args:
         metabase_db_file: The path to the database file, in case of h2.
         metabase_db_host: The database host.
         metabase_db_name: The name of the database.
         metabase_db_password: The database password.
         metabase_db_port: The database port.
         metabase_db_type: Database type to connect to.
         metabase_db_user: The database user.
         metabase_host: The hostname to listen on.
         metabase_port: The port for metabase to listen on.
         metabase_version: The version of metabase.
         password_complexity: Allowed password complexity (weak|normal|strong).
         password_length: Minimal password length.

    """

    FRECKLET_ID = "metabase-service"

    def __init__(self, metabase_db_file=None, metabase_db_host="localhost", metabase_db_name="metabase", metabase_db_password=None, metabase_db_port=None, metabase_db_type="h2", metabase_db_user="metabase", metabase_host="localhost", metabase_port=3000, metabase_version="0.31.2", password_complexity="normal", password_length=8):

        super(MetabaseService, self).__init__(var_names=["metabase_db_file", "metabase_db_host", "metabase_db_name", "metabase_db_password", "metabase_db_port", "metabase_db_type", "metabase_db_user", "metabase_host", "metabase_port", "metabase_version", "password_complexity", "password_length"])
        self._metabase_db_file = metabase_db_file
        self._metabase_db_host = metabase_db_host
        self._metabase_db_name = metabase_db_name
        self._metabase_db_password = metabase_db_password
        self._metabase_db_port = metabase_db_port
        self._metabase_db_type = metabase_db_type
        self._metabase_db_user = metabase_db_user
        self._metabase_host = metabase_host
        self._metabase_port = metabase_port
        self._metabase_version = metabase_version
        self._password_complexity = password_complexity
        self._password_length = password_length

    @property
    def metabase_db_file(self):
        return self._metabase_db_file

    @metabase_db_file.setter
    def metabase_db_file(self, metabase_db_file):
        self._metabase_db_file = metabase_db_file

    @property
    def metabase_db_host(self):
        return self._metabase_db_host

    @metabase_db_host.setter
    def metabase_db_host(self, metabase_db_host):
        self._metabase_db_host = metabase_db_host

    @property
    def metabase_db_name(self):
        return self._metabase_db_name

    @metabase_db_name.setter
    def metabase_db_name(self, metabase_db_name):
        self._metabase_db_name = metabase_db_name

    @property
    def metabase_db_password(self):
        return self._metabase_db_password

    @metabase_db_password.setter
    def metabase_db_password(self, metabase_db_password):
        self._metabase_db_password = metabase_db_password

    @property
    def metabase_db_port(self):
        return self._metabase_db_port

    @metabase_db_port.setter
    def metabase_db_port(self, metabase_db_port):
        self._metabase_db_port = metabase_db_port

    @property
    def metabase_db_type(self):
        return self._metabase_db_type

    @metabase_db_type.setter
    def metabase_db_type(self, metabase_db_type):
        self._metabase_db_type = metabase_db_type

    @property
    def metabase_db_user(self):
        return self._metabase_db_user

    @metabase_db_user.setter
    def metabase_db_user(self, metabase_db_user):
        self._metabase_db_user = metabase_db_user

    @property
    def metabase_host(self):
        return self._metabase_host

    @metabase_host.setter
    def metabase_host(self, metabase_host):
        self._metabase_host = metabase_host

    @property
    def metabase_port(self):
        return self._metabase_port

    @metabase_port.setter
    def metabase_port(self, metabase_port):
        self._metabase_port = metabase_port

    @property
    def metabase_version(self):
        return self._metabase_version

    @metabase_version.setter
    def metabase_version(self, metabase_version):
        self._metabase_version = metabase_version

    @property
    def password_complexity(self):
        return self._password_complexity

    @password_complexity.setter
    def password_complexity(self, password_complexity):
        self._password_complexity = password_complexity

    @property
    def password_length(self):
        return self._password_length

    @password_length.setter
    def password_length(self, password_length):
        self._password_length = password_length



frecklet_class = MetabaseService