Hi Thomas,
I use the following script to install salt from a git checkout and point it to a custom root dir by default (to run from a virtualenv):
#!/bin/bash
salt_repo="/home/salt-test/salt"
salt_root="/home/salt-test/salt-root"
set -e
if [[ "$1" != "--no-req" ]]; then
if [[ -n "$VIRTUAL_ENV" ]]; then
find "$VIRTUAL_ENV" -name '*.pyc' -delete
fi
if [[ $(python --version 2>&1) =~ Python\ 2\.7 ]]; then
pip install -r "${salt_repo}/requirements/dev_python27.txt"
else
pip install -r "${salt_repo}/requirements/dev_python34.txt"
fi
pip install -r "${salt_repo}/requirements/zeromq.txt"
fi
find "${salt_repo}" -name '*.pyc' -delete
GENERATE_SALT_SYSPATHS=1 pip install --global-option="--salt-root-dir=${salt_root}" -e "${salt_repo}"
This is taken from here:
https://docs.saltstack.com/en/develop/topics/development/hacking.html#changing-default-pathsThis wouldn't solve the permissions issue which may require additional troubleshooting, but hopefully would help to keep things logically separated.
NOTE: requirements/dev_python*.txt are currently broken on 2018.3 and develop, so something like "echo '-r base.txt' > base-py2.txt" is needed to work around.
Other useful links:
https://docs.saltstack.com/en/latest/topics/ssh/index.html#define-cli-options-with-saltfilehttps://docs.saltstack.com/en/latest/ref/configuration/nonroot.html