Skip to content

Instantly share code, notes, and snippets.

@giner
Last active November 25, 2020 15:45
Show Gist options
  • Save giner/2bec2d84511d74ceb20ee9a4adbb9c4c to your computer and use it in GitHub Desktop.
Save giner/2bec2d84511d74ceb20ee9a4adbb9c4c to your computer and use it in GitHub Desktop.
Install ansible to a dedicated directory with all dependencies
ansible_version="2.9.*"
sudo apt-add-repository universe
sudo apt install -y python3-pip python3-venv
[[ -d "$HOME/bin" ]] || { mkdir "$HOME/bin"; source $HOME/.profile; }
python3 -m venv ~/ansible
~/ansible/bin/pip3 install wheel
~/ansible/bin/pip3 install ansible=="$ansible_version"
for file in ~/ansible/bin/ansible*; do
ln -sfd "$file" ~/bin/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment