Last active
May 9, 2018 21:08
-
-
Save rsmartins78/c179babc4bc877a87e2f2030fc471f25 to your computer and use it in GitHub Desktop.
Revisions
-
rsmartins78 renamed this gist
May 9, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rsmartins78 created this gist
May 9, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,70 @@ #!/bin/bash ## Escolha abaixo o que será instalado !! ## 0 = Não, 1 = Sim docker=1 ansible=1 ## Caso haja proxy, favor definir abaixo proxy=COLOCAR_IP_DO_PROXY porta=COLOCAR_PORTA_DO_PROXY function setproxy() { http_proxy=http://${proxy}:${porta} https_proxy=http://${proxy}:${porta} ftp_proxy=http://${proxy}:${porta} no_proxy=localhost,127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 export http_proxy https_proxy ftp_proxy no_proxy echo "Configurando proxy no Ambiente" printf "export http_proxy=${http_proxy}\nexport https_proxy=${http_proxy}\nexport ftp_proxy=${http_proxy}\nexport no_proxy=${no_proxy}" >> /etc/environment printf "export http_proxy=${http_proxy}\nexport https_proxy=${http_proxy}\nexport ftp_proxy=${http_proxy}\nexport no_proxy=${no_proxy}" >> /etc/profile } function installdocker(){ USER=vagrant echo "Instalando Docker" curl -4 https://get.docker.com | sh - > /dev/null usermod -aG docker $USER systemctl start docker && systemctl enable docker if [ -n $http_proxy ]; then printf "Configurando proxy no Docker" # Criando pasta docker.service.d mkdir -p /etc/systemd/system/docker.service.d ## Configurando proxy no Docker printf "[Service]\nEnvironment="HTTP_PROXY=${http_proxy}"" >> /etc/systemd/system/docker.service.d/http-proxy.conf systemctl daemon-reload && systemctl restart docker fi } function installansible(){ yum install epel-release -y yum install ansible -y } if [ -n $proxy ]; then echo "Definindo Proxy" setproxy fi if [ $docker -eq '1' ]; then installdocker echo "Docker Instalado" else echo "Docker não selecionado para instalação !!" fi if [ $ansible -eq '1' ]; then installansible echo "Ansible Instalado" else echo "Ansible não selecionado para instalação !!" fi if [ $docker -eq '1' ] || [ $docker -eq '1' ];then echo "Instalações realizadas"; else echo "Nada a ser instalado, máquina virtual pronta"; fi