Browse Source

add mongo

master
zeus 4 years ago
parent
commit
edbd76ec53
  1. 12
      install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/mongodb-org-shell.yml
  2. 24
      install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/mongodb-org-shell.yml.sh

12
install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/mongodb-org-shell.yml

@ -27,18 +27,6 @@
script:
cmd: /project/mongo-update.sh
# - name: apt mongo key
# become: true
# apt_key:
# id: 68980A0EA10B4DE8
# keyserver: keyserver.ubuntu.com
#
# - name: apt mongo repo
# become: true
# apt_repository:
# repo: deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse
# state: present
# ------------------------
# apt update
# -------------------------

24
install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/mongodb-org-shell.yml.sh

@ -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

Loading…
Cancel
Save