From 006305ab4ffcbb9061a78735b4321ee2d37b3113 Mon Sep 17 00:00:00 2001 From: Gilles Mouchet Date: Tue, 21 May 2024 23:46:12 +0200 Subject: [PATCH] add ansible --- inst-raps.sh | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/inst-raps.sh b/inst-raps.sh index f49f9fe..82ae0de 100755 --- a/inst-raps.sh +++ b/inst-raps.sh @@ -94,4 +94,37 @@ else # let retVal=retVal+$error # if [ $retVal -ne 0 ]; then printError "Problem to extend root partition";exit; fi # printSuccess "Root partition extended" -fi \ No newline at end of file +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 " \ No newline at end of file