|
|
@ -22,7 +22,29 @@ echo "[service]" > /project/courses/$YAML/inventory.yml |
|
|
|
echo $ip4 >> /project/courses/$YAML/inventory.yml |
|
|
|
|
|
|
|
|
|
|
|
ansible-playbook -u docker -i inventory.yml $YAML.yml -f 5 --ask-pass --ask-become-pass |
|
|
|
VAR=$(cat <<'END_HEREDOC' |
|
|
|
sudo rm -f /etc/apt/sources.list.d/repo_mongodb_org_apt_ubuntu.list |
|
|
|
sudo rm -f /etc/apt/sources.list.d/mongodb*.list |
|
|
|
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 656408E390CFB1F5 |
|
|
|
echo "deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu $(lsb_release -sc)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org.list |
|
|
|
END_HEREDOC |
|
|
|
) |
|
|
|
|
|
|
|
echo "" |
|
|
|
echo "These comands will be executed first on the remote servers." |
|
|
|
echo "They are located under the files/mongo-update.sh file." |
|
|
|
echo "" |
|
|
|
echo "$VAR" |
|
|
|
echo "" |
|
|
|
|
|
|
|
read -p "Continue (y/n)?" CONT |
|
|
|
if [ "$CONT" = "y" ]; then |
|
|
|
ansible-playbook -u docker -i inventory.yml $YAML.yml -f 5 --ask-pass --ask-become-pass |
|
|
|
else |
|
|
|
echo " "; |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# 1st make sudo without password |
|
|
|
# run with keys |
|
|
|
#ansible-playbook -u docker -i inventory.yml $YAML.yml -f 5 --private-key=/home/docker/.ssh/id_rsa |
|
|
|