I have a script that sets several environment variables and then finally calls another script using sudo.
The script run with sudo must be able to pick up those variables, and I'm not always going to be certain what those variables are.
Is there a way of configuring this sudoers entry to allow the command complete access to the callers env vars?
%deploy ALL=NOPASSWD: /bin/build.sh
When I run the sudo command from my script:
sudo -E build.sh "$@"
sudo: sorry, you are not allowed to preserve the environment
Googling around I've only found ways to preserve specific variables and not just everything.