Skip to content

Instantly share code, notes, and snippets.

@ScriptAutomate
Created August 7, 2021 00:02
Show Gist options
  • Save ScriptAutomate/25ece535debfdf571c12e34c1561a77f to your computer and use it in GitHub Desktop.
Save ScriptAutomate/25ece535debfdf571c12e34c1561a77f to your computer and use it in GitHub Desktop.
Install isolated salt, from pip, directly onto OpenSUSE (includes if in containers)
# Tested via
# docker container run --rm -it opensuse/leap:15.3 /bin/bash
# Check if in container
# https://stackoverflow.com/questions/52065842/python-docker-ascii-codec-cant-encode-character
if [ -f /.dockerenv ]; then
echo "Running in container. Setting LANG=C.UTF-8 locale..."
export LANG=C.UTF-8
fi
# Prereqs needed for pyenv
zypper --non-interactive --no-refresh install --auto-agree-with-licenses \
gcc \
git \
automake \
bzip2 \
libbz2-devel \
xz \
xz-devel \
libopenssl-devel \
ncurses-devel \
curl \
readline-devel \
zlib-devel \
tk-devel \
libffi-devel \
sqlite3-devel \
tar \
make
# Install pyenv
BASHRC='/root/.bashrc'
touch $BASHRC
curl https://pyenv.run | bash
{
echo
echo export PATH="/root/.pyenv/bin:\${PATH}"
echo eval '"'"\$(pyenv init --path)"'"'
echo eval '"'"\$(pyenv init -)"'"'
echo eval '"'"\$(pyenv virtualenv-init -)"'"'
echo
} >>"${BASHRC}"
source $BASHRC
# Build Python
pyenv install 3.7.11
# Install salt
pyenv shell 3.7.11
pip install -U pip setuptools wheel
# Install latest Salt currently referenced as tested
# on OpenSUSE systems as of 08/06/2021
pip install salt==3002.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment