idealista/airflow-role

ubuntu, airflow db path - var/lib - opt/airflow

Closed this issue · 1 comments

t4n1o commented

Description

ansible playbook installs to opt/airflow/airflow.db

airflow process launched with systemd uses /opt/airflow/airflow.db
ansible/create_user uses /var/lib/airflow/airflow/airflow.db
opt/bin/airflow also uses /var/lib/airflow/airflow/airflow.db

Just looking for ideas on how to solve this.

Additional Information

I changed a few settings in the webserver.service and Env variable files to make airflow work on ubuntu server LTS 20.04
But this part was broken before that also.

sudo -u airflow bash -c "/opt/airflow/bin/airflow config get-value core sql_alchemy_conn"
sqlite:////var/lib/airflow/airflow/airflow.db
sudo -u airflow bash -c "export AIRFLOW_CONFIG=/etc/airflow/airflow.cfg; /opt/airflow/bin/airflow config get-value core sql_alchemy_conn"
sqlite:////opt/airflow/airflow.db
t4n1o commented

I fixed it by making sure the user airflow has the environment variable AIRFLOW_CONFIG = /etc/airflow/airflow.cfg while we run the create user tasks.

If you use sudo in ubuntu it santizes the environemnt (which is the only way to run the rest of the scripts).