Last active
April 10, 2022 04:46
-
-
Save nhthai2005/23b823d3e77b330a74d4dd8795966412 to your computer and use it in GitHub Desktop.
Howto install ansible on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Howto install ansible on Ubuntu | |
python3 -m venv ansible | |
# if Debian/Ubuntu, then: | |
# sudo apt install python3.10-venv | |
# python3.10 -m venv ansible | |
# To access your project | |
source ansible/bin/activate | |
# Install ansible | |
pip install ansible | |
# if you want to install ansible with the specified version | |
# pip install ansible==2.9.9 | |
# Add alias to .bashrc or .zshrc to activate ansible conveniently. | |
echo alias source-ansible=\"source $(dirname $(which ansible))/activate\" >> ~/.bashrc #if using bash | |
echo alias source-ansible=\"source $(dirname $(which ansible))/activate\" >> ~/.zshrc #if using zsh | |
# To exit your project | |
deactivate | |
# Try accessing your project with alias by closing your terminal and run the following command | |
source-ansible | |
ansible --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment