ultraInstinct
ultraInstinct

Reputation: 4323

Set env variable in sudo when provisioning Vagrant

I'm trying to install a python package in a Vagrant box that runs in Ubuntu 14 with sudo, this package requires to set an env variable before.

I have tried the following commands, but it did not recognize the env variable when provisioning Vagrant: sudo AIRFLOW_GPL_UNIDECODE=yes sudo pip install apache-airflow==1.10.0 What's the best way to set it?

Upvotes: 0

Views: 101

Answers (1)

xhienne
xhienne

Reputation: 6144

Everything must be done with one command, else what you have done with the first command would be forgotten when the second command runs:

sudo AIRFLOW_GPL_UNIDECODE=yes pip install apache-airflow==1.10.0

Note: when using the Bourne shell, the syntax

VAR1=val1 ... VARn=valN command arg1 ... argN

... runs command arg1 ... argN with all variables VAR1, ..., VARN added as its environment variables.

Upvotes: 1

Related Questions