superset-service-database-exists

Description

Create a Postgresql database for Superset.

Variables

Name Type Default Description

db_host_ip

string 127.0.0.1

The db host ip address.

db_name

string superset

the db name.

db_password

string --

The db password.

db_user

string superset

The db username.

Code

doc:
  short_help: Create a Postgresql database for Superset.
args:
  _import: superset-service

frecklets:
- postgresql-database-exists:
    db_name: '{{:: db_name ::}}'
    db_user: '{{:: db_user ::}}'
    db_user_password: '{{:: db_password | postgresql_password_hash(db_user) ::}}'
    postgresql_listen_addresses:
    - '{{:: db_host_ip ::}}'
#      postgresql_listen_addresses:
#        - localhost
#        - 192.168.178.204
#        - 192.168.194.204
    postgresql_pg_hba:
    - method: md5
#      no_setup_postgresql: true
frecklecute --community superset-service-database-exists --help

Usage: frecklecute superset-service-database-exists [OPTIONS]

  Create a Postgresql database for Superset.

Options:
  --db-host-ip DB_HOST_IP    The db host ip address.
  --db-name DB_NAME          the db name.
  --db-password DB_PASSWORD  The db password.
  --db-user DB_USER          The db username.
  --help                     Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.superset_service_database_exists.SupersetServiceDatabaseExists
#


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

@dataclass
class SupersetServiceDatabaseExists(AutoPycklet):
    """Create a Postgresql database for Superset.

       Args:
         db_host_ip: The db host ip address.
         db_name: the db name.
         db_password: The db password.
         db_user: The db username.

    """

    FRECKLET_ID = "superset-service-database-exists"

    db_host_ip: str = None
    db_name: str = None
    db_password: str = None
    db_user: str = None


    def __post_init__(self):
        super(SupersetServiceDatabaseExists, self).__init__(var_names=["db_host_ip", "db_name", "db_password", "db_user"])


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


#
# module path: pycklets.superset_service_database_exists.SupersetServiceDatabaseExists
#


from pyckles import AutoPycklet

class SupersetServiceDatabaseExists(AutoPycklet):
    """Create a Postgresql database for Superset.

       Args:
         db_host_ip: The db host ip address.
         db_name: the db name.
         db_password: The db password.
         db_user: The db username.

    """

    FRECKLET_ID = "superset-service-database-exists"

    def __init__(self, db_host_ip="127.0.0.1", db_name="superset", db_password=None, db_user="superset"):

        super(SupersetServiceDatabaseExists, self).__init__(var_names=["db_host_ip", "db_name", "db_password", "db_user"])
        self._db_host_ip = db_host_ip
        self._db_name = db_name
        self._db_password = db_password
        self._db_user = db_user

    @property
    def db_host_ip(self):
        return self._db_host_ip

    @db_host_ip.setter
    def db_host_ip(self, db_host_ip):
        self._db_host_ip = db_host_ip

    @property
    def db_name(self):
        return self._db_name

    @db_name.setter
    def db_name(self, db_name):
        self._db_name = db_name

    @property
    def db_password(self):
        return self._db_password

    @db_password.setter
    def db_password(self, db_password):
        self._db_password = db_password

    @property
    def db_user(self):
        return self._db_user

    @db_user.setter
    def db_user(self, db_user):
        self._db_user = db_user



frecklet_class = SupersetServiceDatabaseExists