diff --git a/create-cont.sh b/create-cont.sh index 668a69d..924e8c5 100755 --- a/create-cont.sh +++ b/create-cont.sh @@ -35,7 +35,7 @@ echo "creation des ip des containers dans /etc/hosts" echo "################################" for x in $(seq 0 4); do echo "$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' rocky-$x) rocky-$x" >> /tmp/hosts;done for x in $(seq 0 4); do echo "$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' debian-$x) debian-$x" >> /tmp/hosts;done -sudo cp /tmp/host /etc/hosts +sudo cat /tmp/hosts >> /etc/hosts #echo "installation depuis galaxy de la collection arista" #echo "installation de l'image ceos & aliasing routeur" #sudo ansible-galaxy collection install arista.eos diff --git a/install_ansible.sh b/install_ansible.sh index 4959b0e..aca5547 100755 --- a/install_ansible.sh +++ b/install_ansible.sh @@ -1,18 +1,22 @@ -#!/bin/bash +#!/bin/bas +NC=`\033[m` +Red=`\033[1;31m` +Blue=`\033[1;34m` + if [ ! -f ~/.ssh/id_ed25519.pub ] then - echo -e "Vous devez installer le package sudo en tant que root et vous rajouter dans le groupe sudo" - echo -e "usermod -a -G sudo nom_utilisateur" - echo -e "Puis revenir en tant que utilisateur" + echo -e '$REDVeuillez créer une clé assymétrique ssh !$NC' exit 1 else if [ $(id -u) -eq 0 ] then - echo -e "Ce script doit être lancé en tant qu'utilisateur appartenant au groupe sudo" + echo -e "$RedCe script doit être lancé en tant qu'utilisateur appartenant au groupe sudo$NC" exit 1 fi fi -echo "Install packages" +echo -e "$Red#################################################" +echo -e "Install packages" +echo -e "#################################################$NC" sudo apt install -y jupyter python3-virtualenv python3-setuptools build-essential libssl-dev libffi-dev python3-dev libkrb5-dev sshpass yamllint python3-pip apt-transport-https ca-certificates curl gnupg2 software-properties-common if [ ! -d /etc/ansible ] then @@ -44,7 +48,9 @@ pip3 install --upgrade git+https://github.com/networkop/docker-topo.git #source ~/.profile #ansible-galaxy collection install arista.eos #ansible-galaxy collection install community.general +echo -e "$Red#################################################" echo -e "Install docker-ce" +echo -e "#################################################$NC" sudo curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg sudo echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list sudo apt update @@ -54,4 +60,6 @@ sudo systemctl enable docker sudo usermod -a -G docker $USER source ~/.bashrc source ~/.profile +echo -e "$Red#################################################" echo -e "Veuillez vous déconnecter de votre session !" +echo -e "#################################################$NC" \ No newline at end of file