-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature replace hash parameters (#20)
* flatten postgresql parameters * Change the way config_sqlalchemy_database_uri is set in superset_config.py when module is managing postgres * Fix logic for setting config_sqlalchemy_database_uri * unwrap password * Flatten gunicorn config hash and add default values to parameters with missing defaults
- Loading branch information
Showing
5 changed files
with
95 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,9 @@ lookup_options: | |
superset::config_secret_key: | ||
convert_to: "Sensitive" | ||
superset::admin_password: | ||
convert_to: "Sensitive" | ||
convert_to: "Sensitive" | ||
superset::pgsql_password: | ||
convert_to: "Sensitive" | ||
|
||
superset::install_dir: "/home/superset" | ||
superset::version: '2.1.0' | ||
|
@@ -25,33 +27,30 @@ superset::admin_lastname: 'admin' | |
superset::admin_email: '[email protected]' | ||
|
||
# Default gunicorn as defined in Superset Documentation https://superset.apache.org/docs/installation/configuring-superset | ||
superset::gunicorn_config: | ||
install_dir: "%{lookup('superset::install_dir')}" | ||
worker_class: "gevent" | ||
workers: 10 | ||
timeout: 120 | ||
bind: "0.0.0.0:%{lookup('superset::port')}" | ||
limit_request_line: 0 | ||
limit_request_field_size: 0 | ||
statsd_host: localhost:8125 | ||
superset::gunicorn_install_dir: "/home/superset" | ||
superset::gunicorn_worker_class: "gevent" | ||
superset::gunicorn_workers: 10 | ||
superset::gunicorn_timeout: 120 | ||
superset::gunicorn_bind: "0.0.0.0:%{lookup('superset::port')}" | ||
superset::gunicorn_limit_request_line: 0 | ||
superset::gunicorn_limit_request_field_size: 0 | ||
superset::gunicorn_statsd_host: localhost:8125 | ||
|
||
superset::manage_config: true | ||
superset::config_row_limit: ~ | ||
superset::config_webserver_port: "%{alias('superset::port')}" | ||
superset::config_secret_key: '53cR37K3y' | ||
superset::config_sqlalchemy_database_uri: "postgresql://%{lookup('superset::pgsql_config.user')}:%{lookup('superset::pgsql_config.password')}@%{lookup('superset::pgsql_config.host')}:%{lookup('superset::pgsql_config.port')}/%{lookup('superset::pgsql_config.database')}" | ||
superset::config_sqlalchemy_database_uri: ~ | ||
superset::config_wtf_csrf_enabled: ~ | ||
superset::config_wtf_csrf_exempt_list: ~ | ||
superset::config_wtf_csrf_time_limit: ~ | ||
superset::config_mapbox_api_key: ~ | ||
|
||
|
||
superset::pgsql_config: | ||
database: 'superset' | ||
user: 'superset' | ||
password: 'password' | ||
host: 'localhost' | ||
port: 5432 | ||
superset::pgsql_database: 'superset' | ||
superset::pgsql_user: 'superset' | ||
superset::pgsql_password: 'password' | ||
superset::pgsql_host: 'localhost' | ||
superset::pgsql_port: 5432 | ||
|
||
superset::python_version: 'python38' | ||
superset::python_pip: 'present' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,16 +52,29 @@ | |
# @param admin_email | ||
# Parameter for setting the admin user email address | ||
# | ||
# @param gunicorn_config | ||
# Overide option for gunicorn. | ||
# Default: | ||
# - install_dir: "%{lookup('superset::install_dir')}" | ||
# - workers: 10 | ||
# - timeout: 120 | ||
# - bind: "0.0.0.0:%{lookup('superset::port')}" | ||
# - limit_request_line: 0 | ||
# - limit_request_field_size: 0 | ||
# - statsd_host: localhost:8125 | ||
# @param gunicorn_install_dir | ||
# Overide for gunicorn install_dir option. | ||
# | ||
# @param gunicorn_workers | ||
# Overide for gunicorn workers option. | ||
# | ||
# @param gunicorn_worker_class | ||
# Overide for gunicorn worker_class option. | ||
# | ||
# @param gunicorn_timeout | ||
# Overide for gunicorn timeout option. | ||
# | ||
# @param gunicorn_bind | ||
# Overide for gunicorn bind option. | ||
# | ||
# @param gunicorn_limit_request_line | ||
# Overide for gunicorn limit_request_line option. | ||
# | ||
# @param gunicorn_limit_request_field_size | ||
# Overide for gunicorn limit_request_field_size option. | ||
# | ||
# @param gunicorn_statsd_host | ||
# Overide for gunicorn statsd_host option. | ||
# | ||
# @param manage_config | ||
# Boolean for setting whether to manage the config file superset_config.py | ||
|
@@ -90,14 +103,20 @@ | |
# @param config_mapbox_api_key | ||
# Optional setting for setting MAPBOX_API_KEY in superset_config.py | ||
# | ||
# @param pgsql_config | ||
# Overide option for overiding the default postgresql configuration | ||
# Available options include: | ||
# - database | ||
# - user | ||
# - password | ||
# - host | ||
# - port | ||
# @param pgsql_database | ||
# Overide option for overiding the default postgresql database | ||
# | ||
# @param pgsql_user | ||
# Overide option for overiding the default postgresql user | ||
# | ||
# @param pgsql_password | ||
# Overide option for overiding the default postgresql password | ||
# | ||
# @param pgsql_host | ||
# Overide option for overiding the default postgresql host | ||
# | ||
# @param pgsql_port | ||
# Overide option for overiding the default postgresql port | ||
# | ||
# @param python_version | ||
# Overide option for setting the Python version if it will be managed by this module | ||
|
@@ -116,22 +135,29 @@ | |
# | ||
# lint:ignore:parameter_order | ||
class superset ( | ||
String $install_dir, | ||
Variant[Enum['present','absent','latest'], String[1]] $version = 'present', | ||
String $install_dir = '/home/superset', | ||
Variant[Enum['present','absent','latest'], String[1]] $version = '2.1.0', | ||
Array[String] $additional_python_lib = [], | ||
Integer $port, | ||
String $user, | ||
Boolean $load_examples, | ||
Boolean $manage_python, | ||
Boolean $manage_webserver, | ||
Boolean $manage_db, | ||
Boolean $manage_firewall, | ||
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 = '[email protected]', | ||
Hash $gunicorn_config, | ||
String $gunicorn_install_dir = '/home/superset', | ||
String $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, | ||
|
@@ -141,12 +167,16 @@ | |
Optional[Array[String]] $config_wtf_csrf_exempt_list = undef, | ||
Optional[Integer] $config_wtf_csrf_time_limit = undef, | ||
Optional[String] $config_mapbox_api_key = undef, | ||
Hash $pgsql_config, | ||
String $python_version, | ||
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 = 'python38', | ||
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, | ||
Array[String] $db_drivers = ['psycopg2'], | ||
) { | ||
# lint:endignore | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters