65 lines
2.5 KiB
Bash
Executable File
65 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
NC='\033[m'
|
|
Red='\033[1;31m'
|
|
Blue='\033[1;34m'
|
|
|
|
if [ ! -f ~/.ssh/id_ed25519.pub ]
|
|
then
|
|
echo -e '$REDVeuillez créer une clé assymétrique ssh !$NC'
|
|
exit 1
|
|
else
|
|
if [ $(id -u) -eq 0 ]
|
|
then
|
|
echo -e "$RedCe script doit être lancé en tant qu'utilisateur appartenant au groupe sudo$NC"
|
|
exit 1
|
|
fi
|
|
fi
|
|
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
|
|
sudo mkdir /etc/ansible
|
|
sudo mkdir /etc/ansible/group_vars
|
|
sudo mkdir /etc/ansible/roles
|
|
sudo cp ./group_vars/* /etc/ansible/group_vars/
|
|
sudo cp ./ansible.cfg /etc/ansible/ansible.cfg
|
|
sudo cp ./hosts /etc/ansible/hosts
|
|
fi
|
|
pip3 install ansible
|
|
pip3 install ansible-lint
|
|
pip3 install ansible-runner
|
|
pip3 install ansible-builder
|
|
pip3 install netmiko
|
|
pip3 install netaddr
|
|
pip3 install argcomplete
|
|
activate-global-python-argcomplete
|
|
pip3 install cryptography --upgrade
|
|
pip3 install pywinrm
|
|
pip3 install pywinrm[credssp]
|
|
pip3 install pywinrm[kerberos]
|
|
pip3 install molecule[ansible,docker,lint]
|
|
# pip3 install docker
|
|
pip3 install ansible-navigator[ansible-core]
|
|
pip3 install --upgrade git+https://github.com/networkop/docker-topo.git
|
|
# pip3 ensurepath
|
|
#source ~/.bashrc
|
|
#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
|
|
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose
|
|
sudo systemctl enable docker
|
|
#sudo groupadd 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" |