superset
Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2021.7.x
- Puppet >= 7.24.0 < 9.0.0
- ,
Tasks:
- delete_superset_venv
Start using this module
Add this module to your Puppetfile:
mod 'jortencio-superset', '2.0.0'
Learn more about managing modules with a PuppetfileDocumentation
superset
A Puppet module that is used for installing and configuring Apache Superset which is a data exploration and visualization platform.
For more information, please visit Apache Superset.
Table of Contents
- Description
- Setup - The basics of getting started with superset
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
This Puppet module is used to do basic installation and configuration of Apache Superset.
Setup
What superset affects
Superset module installs and configures the following:
- Superset dependencies
- Python (Optional)
- Creates a Python virtual environment and installs dependent Python Libraries (including superset) within it
- Configures Firewalld on RHEL (Optional)
- Installs and configures a basic Postgresql Database as a Superset Back-end (Optional)
- Manages a Gunicorn web server for hosting superset (Optional)
Any of the services marked as (Optional) above can be managed seperately by setting the relevant parameters to false (See reference)
Setup Requirements
In order to use this module, make sure to have the following Puppet modules installed:
- puppetlabs-stdlib
- puppet-python
- puppet-epel
- puppetlabs-yumrepo_core
- puppet-firewalld
- puppetlabs-augeas_core
- puppetlabs-postgresql
- puppetlabs-apt
- puppetlabs-concat
Beginning with superset
In order to get started with the superset Puppet module with a basic configuration (Basic Install of Apache Superset with Python, Gunicorn, Postgresql installed/configured)
include superset
Usage
This module supports the use of Hiera data for setting parameters. Please refer to REFERENCE.md for a list of configurable parameters
Common Usage
Setup Superset with a configured admin user
class { 'superset':
admin_username => '<username>',
admin_password => '<password>',
admin_firstname => '<firstname>',
admin_lastname => '<password>',
admin_email => '<email>',
}
Setup Superset to manage firewalld on RedHat Linux
class { 'superset':
manage_firewall => true,
}
Change default database in Superset config file (superset_config.py)
class { 'superset':
manage_db => false,
config_sqlalchemy_database_uri => <Database URI>,
}
Note: To see a list of supported databases and format for sqlalchemy_database_uri, please see: Installing Database URI
Note 2: When installing on another database, please also configure the superset::db_drivers to include additional database drivers. By default, the postgresql driver will already be included in this list.
Setting sensitive data
To set sensitive data such as admin the postgresql DB password, use the Sensitive in a class declaration. e.g.:
class { 'superset':
pgsql_password => Sensitive('<password>'),
}
Alternatively, use lookup_options
in hiera. e.g.:
---
lookup_options:
superset::pgsql_password:
convert_to: "Sensitive"
superset::pgsql_password: '<password>'
Setting a gunicorn worker class:
In class declaration:
class { 'superset':
gunicorn_worker_class => 'tornado',
}
In Hiera:
---
superset::gunicorn_worker_class: "tornado"
Limitations
The Superset module has a number of limitations:
- It has only been tested to work on RedHat 8, RedHat9, Ubuntu 20.04, Ubuntu 22.04
- Superset app configuration file limited to options currently specified in the epp template
- It is currently only to install the current latest version of the python Superset library. As at this release it is version 4.0.2 (Except for Ubuntu 20.04 install which installs 2.1.3 by default)
- The admin parameters are limited in that any previously configured admin users will remain in Superset's DB and will need to be removed manually within the Superset
- i.e. Log in as a user with the Admin role, click on Settings and under Security click on List User. Here you can see the previous admin user and delete the entry
Development
If you would like to contribute with the development of this module, please feel free to log development changes in the issues register for this project or submit a Pull Request.
Reference
Table of Contents
Classes
Public Classes
superset
: Superset main class that has parameters for customising the installation and configuration of Apache Superset lint:ignore:140chars lint:ign
Private Classes
superset::config
: Manages the superset_config.py configuration filesuperset::firewalld
: Manages firewalld service and opens Superset portsuperset::init_db
: Initialises the superset db with an admin user, default roles and default permissions. Can also optionally load examples lint:ignore:140chasuperset::install
: Creates the Superset user and configures a Python virtual environment for installing Apache Superset and its dependent Python librariessuperset::packages
: Manages package dependencies for Supersetsuperset::postgresql
: Manages a basic postgresql backend for supersetsuperset::python
: Installs and configures the Pythonsuperset::service
: Configures and manages Superset service (using Gunicorn)
Tasks
delete_superset_venv
: A task for deleting the Apache Superset virtual environment directory
Classes
superset
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
The following parameters are available in the superset
class:
install_dir
version
additional_python_lib
port
user
load_examples
manage_python
manage_webserver
manage_db
manage_firewall
admin_username
admin_password
admin_firstname
admin_lastname
admin_email
gunicorn_install_dir
gunicorn_workers
gunicorn_worker_class
gunicorn_timeout
gunicorn_bind
gunicorn_limit_request_line
gunicorn_limit_request_field_size
gunicorn_statsd_host
manage_config
config_row_limit
config_webserver_port
config_secret_key
config_sqlalchemy_database_uri
config_wtf_csrf_enabled
config_wtf_csrf_exempt_list
config_wtf_csrf_time_limit
config_mapbox_api_key
pgsql_database
pgsql_user
pgsql_password
pgsql_host
pgsql_port
python_version
python_pip
python_dev
python_venv
db_drivers
install_dir
Data type: String
The directory that a Python Virtual Environment will be created under and where Superset will be installed
Default value: '/home/superset'
version
Data type: Variant[Enum['present','absent','latest'], String[1]]
The version of Apache Superset to install.
Default value: '2.1.0'
additional_python_lib
Data type: Array[String]
Array of additional python libraries to install.
Default value: []
port
Data type: Integer
The port that that superset will be served from. Default: 8088
Default value: 8088
user
Data type: String
The owner of any file/folders created for the Superset installation
Default value: 'superset'
load_examples
Data type: Boolean
Option for loading example charts and data. Default: false
Default value: false
manage_python
Data type: Boolean
Option for managing the installation of python. Default: true
Default value: true
manage_webserver
Data type: Boolean
Option for managing a gunicorn webserver. Default: true
Default value: true
manage_db
Data type: Boolean
Option for managing a Postgresql db back-end. Default: true
Default value: true
manage_firewall
Data type: Boolean
Option for managing firewall (RHEL8 firwalld). Default: false
Default value: false
admin_username
Data type: String
Parameter for setting the admin user username
Default value: 'admin'
admin_password
Data type: Sensitive[String]
Sensitive parameter for setting the admin user password
Default value: Sensitive('password')
admin_firstname
Data type: String
Parameter for setting the admin user first name
Default value: 'admin'
admin_lastname
Data type: String
Parameter for setting the admin user last name
Default value: 'admin'
admin_email
Data type: String
Parameter for setting the admin user email address
Default value: 'admin@mycompany.com'
gunicorn_install_dir
Data type: String
Overide for gunicorn install_dir option.
Default value: '/home/superset'
gunicorn_workers
Data type: Integer
Overide for gunicorn workers option.
Default value: 10
gunicorn_worker_class
Data type: Enum['sync','eventlet','gevent','tornado']
Overide for gunicorn worker_class option.
Default value: 'gevent'
gunicorn_timeout
Data type: Integer
Overide for gunicorn timeout option.
Default value: 120
gunicorn_bind
Data type: String
Overide for gunicorn bind option.
Default value: '0.0.0.0:8088'
gunicorn_limit_request_line
Data type: Integer
Overide for gunicorn limit_request_line option.
Default value: 0
gunicorn_limit_request_field_size
Data type: Integer
Overide for gunicorn limit_request_field_size option.
Default value: 0
gunicorn_statsd_host
Data type: String
Overide for gunicorn statsd_host option.
Default value: 'localhost:8125'
manage_config
Data type: Boolean
Boolean for setting whether to manage the config file superset_config.py
Default value: true
config_row_limit
Data type: Optional[Integer]
Optional setting for setting ROW_LIMIT in superset_config.py
Default value: undef
config_webserver_port
Data type: Optional[Integer]
Optional setting for setting SUPERSET_WEBSERVER_PORT in superset_config.py
Default value: undef
config_secret_key
Data type: Sensitive[String]
Sensitive parameter for setting SECRET_KEY in superset_config.py
Default value: Sensitive('53cR37K3y')
config_sqlalchemy_database_uri
Data type: Optional[String]
Optional setting for setting SQLALCHEMY_DATABASE_URI in superset_config.py
Default value: undef
config_wtf_csrf_enabled
Data type: Optional[Boolean]
Optional setting for setting WTF_CSRF_ENABLED in superset_config.py
Default value: undef
config_wtf_csrf_exempt_list
Data type: Optional[Array[String]]
Optional setting for setting WTF_CSRF_EXEMPT_LIST in superset_config.py
Default value: undef
config_wtf_csrf_time_limit
Data type: Optional[Integer]
Optional setting for setting WTF_CSRF_TIME_LIMIT in superset_config.py
Default value: undef
config_mapbox_api_key
Data type: Optional[String]
Optional setting for setting MAPBOX_API_KEY in superset_config.py
Default value: undef
pgsql_database
Data type: String
Overide option for overiding the default postgresql database
Default value: 'superset'
pgsql_user
Data type: String
Overide option for overiding the default postgresql user
Default value: 'superset'
pgsql_password
Data type: Sensitive[String]
Overide option for overiding the default postgresql password
Default value: Sensitive('password')
pgsql_host
Data type: String
Overide option for overiding the default postgresql host
Default value: 'localhost'
pgsql_port
Data type: Integer
Overide option for overiding the default postgresql port
Default value: 5432
python_version
Data type: String
Overide option for setting the Python version if it will be managed by this module
Default value: 'python39'
python_pip
Data type: Enum['present','absent','latest']
Parameter for setting whether the ensure python-pip is present, absent or latest
Default value: 'present'
python_dev
Data type: Enum['present','absent','latest']
Parameter for setting whether the ensure python-dev is present, absent or latest
Default value: 'present'
python_venv
Data type: Enum['present','absent','latest']
Parameter for setting whether the ensure python-venv is present, absent or latest
Default value: 'absent'
db_drivers
Data type: Array[String]
Overide option for setting database drivers (python database driver packages) to be installed
Default value: ['psycopg2']
Tasks
delete_superset_venv
A task for deleting the Apache Superset virtual environment directory
Supports noop? false
What are tasks?
Modules can contain tasks that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Tasks in this module release
delete_superset_venv
A task for deleting the Apache Superset virtual environment directory
Changelog
All notable changes to this project will be documented in this file.
Release 2.0.0
Features
- Update default superset version to 4.0.2 (And minimum Python 3.9) (Except for Ubuntu 20.04 which defaults to version 2.1.3 due to default Python 3.8 ) #28
- Added support for Ubuntu 22.04 #30
- Added support for RHEL 9 #32
- Tested for Puppet 8 compatibility #33
- Add task for deleting Apache Superset virtual environment (to assist with fixing installation issues) #34
BugFixes
- Resolves error related to Werkzeug version 3.0.4 compatibility with Flask version 2.x.x #27
Known Issues
- Doesn't delete previous admin user when the admin user is updated in hiera
Release 1.0.0
Features
- Added Ubuntu 20.04 support #17
- Added support for setting different gunicorn working classes #21
- Flattened hash type parameters into seperate parameters for ease of setting parameters. Refer to Reference.md for details. #20
- Updated Superset parameters to secure passwords and secret keys with sensitive type (e.g. #15)
- Added parameter
additional_python_lib
to help manage issues with problematic python libraries. (e.g. #14) - Added performance improvements to initial installation. Thank you Gigko! #13
- General cleanup of manifests to align with Puppet style guide
- Update module dependency minimum requirements. See dependencies for details.
- Update PDK template to v3.0.0
Bugfixes
- Fix issues caused by newer versions of sqlparse and marshmellow-enum python libraries #14
Known Issues
- Doesn't delete previous admin user when the admin user is updated in hiera
- Gunicorn worker classes
gevent
andeventlet
currently not working due toselect.epoll()
issues. Recommend usingtornado
orsync
worker class for this version.
Release 0.1.1
Bugfixes
- Fixed issue "broken superset install - cannot import name 'soft_unicode' from 'markupsafe'" #8
Known Issues
- Doesn't delete previous admin user when the admin user is updated in hiera
Release 0.1.0
Features
- Initial Release - Basic Installation of Apache Superset
Known Issues
- Doesn't delete previous admin user when the admin user is updated in hiera
Dependencies
- puppetlabs/stdlib (>= 9.2.0 < 10.0.0)
- puppet/python (>= 7.3.0 < 8.0.0)
- puppet/epel (>= 4.1.0 < 5.0.0)
- puppetlabs/yumrepo_core (>= 2.0.0 < 3.0.0)
- puppet/firewalld (>= 4.5.1 < 5.0.0)
- puppetlabs/augeas_core (>= 1.3.0 < 2.0.0)
- puppetlabs/postgresql (>= 9.1.0 < 10.0.0)
- puppet/systemd (>= 5.2.0 < 6.0.0)
- puppetlabs/apt (>= 9.1.0 < 10.0.0)
- puppetlabs/concat (>= 9.0.0 < 10.0.0)