Nov 7, 2022 - Systemd Start Script for Superset

Create the file superset.service at /lib/systemd/system/superset.service and insert the following. Note the user is sysadmin, the port is 8088 and superset is installed in the /opt/super python virtual environment

Description=Start Superset

ExecStart=/opt/super/bin/superset run -p 8088 --with-threads --reload --debugger --host


To start the service

systemctl daemon-reload
systemctl start superset

Oct 1, 2022 - Installing Apache SuperSet

Update, Upgrade and install Dependancies

apt-get update
apt-get -y upgrade
apt-get -y install build-essential libssl-dev libffi-dev python3-dev python3-pip libsasl2-dev libldap2-dev default-libmysqlclient-dev libpq-dev python-is-python3

Install Superset set with pip on Ubuntu 20.04 while version locking a few packages

pip install --upgrade pip
pip install --upgrade pip --no-warn-script-location
pip install werkzeug==2.0.3 --no-warn-script-location
pip install flask==2.1.3 --no-warn-script-location
pip install wtforms==2.3.0 --no-warn-script-location
pip install --upgrade pyopenssl --no-warn-script-location
pip install psycopg2-binary pillow gunicorn gevent --no-warn-script-location

pip install apache-superset --no-warn-script-location

Configuring Superset and create a Superset user

sudo echo -e 'export FLASK_APP=superset' >> /etc/profile.d/
export FLASK_APP=superset
FLASK_APP=superset /home/ubuntu/.local/bin/superset db upgrade

FLASK_APP=superset /home/ubuntu/.local/bin/superset fab create-admin --username admin --firstname Fname --lastname Sirname --email --password <PASSWORD>

FLASK_APP=superset /home/ubuntu/.local/bin/superset init

Starting the application

#enable the python virtual environment
source super/bin/active	 
export FLASK_APP=superset
superset init
superset run -p 8088 --with-threads --reload --debugger --host

Configuring Apache2 as Proxy with SSL

sudo apt install apache2

Create the following sites in /etc/apache2/sites-available. Please change the to the proper ip or domain.


<VirtualHost *:80>

    #Redirect permanent /
    Redirect permanent /



<VirtualHost *:443>

    #DocumentRoot /var/www

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
    SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
    ProxyPass /
    ProxyPassReverse /
    ProxyRequests off
    ProxyPreserveHost On
    SSLProxyEngine On
    <Proxy *>
        Order deny,allow
        Allow from all

Create an SSL Certificate

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt

Enable the Apache sites, enable SSL and start the Apache2 service

sudo a2ensite website.conf
sudo a2ensite website-ssl.conf
sudo a2enmod ssl
sudo systemctl restart apache2

Aug 10, 2019 - Ansible Windows win_copy is slow

I have found a few problems with using the Ansible module win_copy. The module is slow and unreliable thus causing multiple timeouts. I have found a more reliable and quicker solution by using using win_command with robocopy.

Here is an example on how I used win_copy in the past.

- name: copy ms office dir to c drive
    src:  /misc/filessoftware/chocolatey/msoffice2016/
    dest: C:\msoffice
  ignore_errors: yes
  when: hostvars[inventory_hostname]['ansible_getFacts']['Microsoft Office Professional Plus 2016'] is undefined

The new solution along with mounting a network share.

- name: Transfer of msoffice2016
  win_command: ''
    -  'net use  s: \\\software /P:yes /user:  '
    -  'robocopy s:\msoffice2016 \msoffice2016 /E'
  ignore_errors: yes
  no_log: True 
  when: hostvars[inventory_hostname]['ansible_getFacts']['Microsoft Office Professional Plus 2016'] is undefined