Puppet Class: superset

Defined in:
manifests/init.pp

Summary

Overview

Superset main class that has parameters for customising the installation and configuration of Apache Superset

lint:ignore:140chars

lint:ignore:parameter_order

Examples:

include superset

Parameters:

  • install_dir (String) (defaults to: '/home/superset')

    The directory that a Python Virtual Environment will be created under and where Superset will be installed

  • version (Variant[Enum['present','absent','latest'], String[1]]) (defaults to: '2.1.0')

    The version of Apache Superset to install.

  • additional_python_lib (Array[String]) (defaults to: [])

    Array of additional python libraries to install.

  • port (Integer) (defaults to: 8088)

    The port that that superset will be served from. Default: 8088

  • user (String) (defaults to: 'superset')

    The owner of any file/folders created for the Superset installation

  • load_examples (Boolean) (defaults to: false)

    Option for loading example charts and data. Default: false

  • manage_python (Boolean) (defaults to: true)

    Option for managing the installation of python. Default: true

  • manage_webserver (Boolean) (defaults to: true)

    Option for managing a gunicorn webserver. Default: true

  • manage_db (Boolean) (defaults to: true)

    Option for managing a Postgresql db back-end. Default: true

  • manage_firewall (Boolean) (defaults to: false)

    Option for managing firewall (RHEL8 firwalld). Default: false

  • admin_username (String) (defaults to: 'admin')

    Parameter for setting the admin user username

  • admin_password (Sensitive[String]) (defaults to: Sensitive('password'))

    Sensitive parameter for setting the admin user password

  • admin_firstname (String) (defaults to: 'admin')

    Parameter for setting the admin user first name

  • admin_lastname (String) (defaults to: 'admin')

    Parameter for setting the admin user last name

  • admin_email (String) (defaults to: 'admin@mycompany.com')

    Parameter for setting the admin user email address

  • gunicorn_install_dir (String) (defaults to: '/home/superset')

    Overide for gunicorn install_dir option.

  • gunicorn_workers (Integer) (defaults to: 10)

    Overide for gunicorn workers option.

  • gunicorn_worker_class (Enum['sync','eventlet','gevent','tornado']) (defaults to: 'gevent')

    Overide for gunicorn worker_class option.

  • gunicorn_timeout (Integer) (defaults to: 120)

    Overide for gunicorn timeout option.

  • gunicorn_bind (String) (defaults to: '0.0.0.0:8088')

    Overide for gunicorn bind option.

  • gunicorn_limit_request_line (Integer) (defaults to: 0)

    Overide for gunicorn limit_request_line option.

  • gunicorn_limit_request_field_size (Integer) (defaults to: 0)

    Overide for gunicorn limit_request_field_size option.

  • gunicorn_statsd_host (String) (defaults to: 'localhost:8125')

    Overide for gunicorn statsd_host option.

  • manage_config (Boolean) (defaults to: true)

    Boolean for setting whether to manage the config file superset_config.py

  • config_row_limit (Optional[Integer]) (defaults to: undef)

    Optional setting for setting ROW_LIMIT in superset_config.py

  • config_webserver_port (Optional[Integer]) (defaults to: undef)

    Optional setting for setting SUPERSET_WEBSERVER_PORT in superset_config.py

  • config_secret_key (Sensitive[String]) (defaults to: Sensitive('53cR37K3y'))

    Sensitive parameter for setting SECRET_KEY in superset_config.py

  • config_sqlalchemy_database_uri (Optional[String]) (defaults to: undef)

    Optional setting for setting SQLALCHEMY_DATABASE_URI in superset_config.py

  • config_wtf_csrf_enabled (Optional[Boolean]) (defaults to: undef)

    Optional setting for setting WTF_CSRF_ENABLED in superset_config.py

  • config_wtf_csrf_exempt_list (Optional[Array[String]]) (defaults to: undef)

    Optional setting for setting WTF_CSRF_EXEMPT_LIST in superset_config.py

  • config_wtf_csrf_time_limit (Optional[Integer]) (defaults to: undef)

    Optional setting for setting WTF_CSRF_TIME_LIMIT in superset_config.py

  • config_mapbox_api_key (Optional[String]) (defaults to: undef)

    Optional setting for setting MAPBOX_API_KEY in superset_config.py

  • pgsql_database (String) (defaults to: 'superset')

    Overide option for overiding the default postgresql database

  • pgsql_user (String) (defaults to: 'superset')

    Overide option for overiding the default postgresql user

  • pgsql_password (Sensitive[String]) (defaults to: Sensitive('password'))

    Overide option for overiding the default postgresql password

  • pgsql_host (String) (defaults to: 'localhost')

    Overide option for overiding the default postgresql host

  • pgsql_port (Integer) (defaults to: 5432)

    Overide option for overiding the default postgresql port

  • python_version (String) (defaults to: 'python39')

    Overide option for setting the Python version if it will be managed by this module

  • python_pip (Enum['present','absent','latest']) (defaults to: 'present')

    Parameter for setting whether the ensure python-pip is present, absent or latest

  • python_dev (Enum['present','absent','latest']) (defaults to: 'present')

    Parameter for setting whether the ensure python-dev is present, absent or latest

  • python_venv (Enum['present','absent','latest']) (defaults to: 'absent')

    Parameter for setting whether the ensure python-venv is present, absent or latest

  • db_drivers (Array[String]) (defaults to: ['psycopg2'])

    Overide option for setting database drivers (python database driver packages) to be installed



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'manifests/init.pp', line 137

class superset (
  String                                                $install_dir = '/home/superset',
  Variant[Enum['present','absent','latest'], String[1]] $version = '2.1.0',
  Array[String]                                         $additional_python_lib = [],
  Integer                                               $port = 8088,
  String                                                $user = 'superset',
  Boolean                                               $load_examples = false,
  Boolean                                               $manage_python = true,
  Boolean                                               $manage_webserver = true,
  Boolean                                               $manage_db = true,
  Boolean                                               $manage_firewall = false,
  String                                                $admin_username = 'admin',
  Sensitive[String]                                     $admin_password = Sensitive('password'),
  String                                                $admin_firstname = 'admin',
  String                                                $admin_lastname = 'admin',
  String                                                $admin_email = 'admin@mycompany.com',
  String                                                $gunicorn_install_dir = '/home/superset',
  Enum['sync','eventlet','gevent','tornado']            $gunicorn_worker_class = 'gevent',
  Integer                                               $gunicorn_workers = 10,
  Integer                                               $gunicorn_timeout = 120,
  String                                                $gunicorn_bind = '0.0.0.0:8088',
  Integer                                               $gunicorn_limit_request_line = 0,
  Integer                                               $gunicorn_limit_request_field_size = 0,
  String                                                $gunicorn_statsd_host = 'localhost:8125',
  Boolean                                               $manage_config = true,
  Optional[Integer]                                     $config_row_limit = undef,
  Optional[Integer]                                     $config_webserver_port = undef,
  Sensitive[String]                                     $config_secret_key = Sensitive('53cR37K3y'),
  Optional[String]                                      $config_sqlalchemy_database_uri = undef,
  Optional[Boolean]                                     $config_wtf_csrf_enabled = undef,
  Optional[Array[String]]                               $config_wtf_csrf_exempt_list = undef,
  Optional[Integer]                                     $config_wtf_csrf_time_limit = undef,
  Optional[String]                                      $config_mapbox_api_key = undef,
  String                                                $pgsql_database = 'superset',
  String                                                $pgsql_user = 'superset',
  Sensitive[String]                                     $pgsql_password = Sensitive('password'),
  String                                                $pgsql_host = 'localhost',
  Integer                                               $pgsql_port = 5432,
  String                                                $python_version = 'python39',
  Enum['present','absent','latest']                     $python_pip = 'present',
  Enum['present','absent','latest']                     $python_dev = 'present',
  Enum['present','absent','latest']                     $python_venv = 'absent',
  Array[String]                                         $db_drivers = ['psycopg2'],
) {
  # lint:endignore

  # Install package dependencies 
  include superset::packages

  # Configure Python
  include superset::python

  # Configure Python Virtual Environment and install Superset
  include superset::install

  # Configure Superset
  include superset::config

  # Install Postgresql database
  include superset::postgresql

  # Initialise Superset Backend Database
  include superset::init_db

  # Configure and start Gunicorn Service
  include superset::service

  # Manage the firwall
  if $manage_firewall {
    include superset::firewalld
  }

  Class['superset::packages']
  -> Class['superset::python']
  -> Class['superset::install']
  -> Class['superset::config']
  -> Class['superset::postgresql']
  -> Class['superset::init_db']
  -> Class['superset::service']
}