Skip to content

Instantly share code, notes, and snippets.

@lorengordon
Last active June 30, 2017 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorengordon/f5bb5d15ff8e23c8809b74a9b17e0c29 to your computer and use it in GitHub Desktop.
Save lorengordon/f5bb5d15ff8e23c8809b74a9b17e0c29 to your computer and use it in GitHub Desktop.
Install salt for development on EL6/7
sudo -i
REPO="https://github.com/<your-fork>/salt"
BRANCH="<your-branch>"
# EL6
#yum -y install centos-release-SCL
#yum -y install python27 python27-python-devel python27-python-setuptools python27-python-tools python27-python-virtualenv
#yum -y --enablerepo=epel install git gcc gcc-c++ swig openssl-devel python27-python-pip
#scl enable python27 bash
# EL7
yum -y --enablerepo=epel install git gcc gcc-c++ swig openssl-devel python-pip python-devel
pip install --upgrade pip setuptools virtualenv
virtualenv --system-site-packages venv
source ./venv/bin/activate
pip install M2Crypto
pip install pyzmq PyYAML pycrypto msgpack-python jinja2 psutil futures tornado
git clone "${REPO}" && cd salt && git checkout "${BRANCH}" && cd ..
pip install -e ./salt
pip install -r ./salt/requirements/dev_python27.txt
mkdir -p ./venv/etc/salt ./venv/etc/salt/pki/master ./venv/etc/salt/pki/minion
cp ./salt/conf/master ./salt/conf/minion ./venv/etc/salt/
sed -i -e 's|[#]\?root_dir:.*|root_dir: /root/venv/|' ./venv/etc/salt/master
sed -i -e 's|[#]\?root_dir:.*|root_dir: /root/venv/|' ./venv/etc/salt/minion
sed -i -e 's|[#]\?pki_dir:.*|pki_dir: /root/venv/etc/salt/pki/master|' ./venv/etc/salt/master
sed -i -e 's|[#]\?pki_dir:.*|pki_dir: /root/venv/etc/salt/pki/minion|' ./venv/etc/salt/minion
sed -i -e 's|[#]\?master:.*|master: localhost|' ./venv/etc/salt/minion
# now use salt like so (-c is important):
salt-call --local -c /root/venv/etc/salt --versions-report
@lorengordon
Copy link
Author

Primary source, plus a bit of trial and error for specifics around EL6/EL7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment