add ansible

This commit is contained in:
Gilles Mouchet 2024-05-21 23:46:12 +02:00
parent c74809d3b3
commit 006305ab4f

View File

@ -95,3 +95,36 @@ else
# if [ $retVal -ne 0 ]; then printError "Problem to extend root partition";exit; fi
# printSuccess "Root partition extended"
fi
#-----------------------------------------------------------------------------
# install package python
#-----------------------------------------------------------------------------
printInfo "Install package"
printSubInfo "install python"
yum install -y python3 python3-pip >/dev/null 2>&1
if [ $? -ne 0 ]; then printError "Problem to install packages";exit; fi
printSuccess "Packages installed successfully"
#-----------------------------------------------------------------------------
# update pip
#-----------------------------------------------------------------------------
printInfo "Upgrade pip3"
pip3 install --upgrade pip >/dev/null 2>&1
if [ $? -ne 0 ]; then printError "Problem to upgrade pip3";exit; fi
printSuccess "Pip3 upgraded successfully"
#-----------------------------------------------------------------------------
# install ansible
#-----------------------------------------------------------------------------
printInfo "Install ansible. Please wait ..."
pip3 install --user ansible >/dev/null 2>&1
if [ $? -ne 0 ]; then printError "Problem to install ansible";exit; fi
printSuccess "Ansible installed successfully"
#-----------------------------------------------------------------------------
# add path .local/bin
#-----------------------------------------------------------------------------
printInfo "Add ./.local/bin in path"
echo "export PATH=~/.local/bin:\$PATH" >> ~/.bashrc
if [ $? -ne 0 ]; then printError "Problem to install ansible";exit; fi
printSuccess "./.local/bin added in path successfully "