Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit c092503f authored by GARNIER Laurent's avatar GARNIER Laurent
Browse files

Merge branch 'Add_tools_folder' into 'django'

Add tools folder

See merge request !214
parents f7bd714b 5939e80b
Pipeline #159929 failed with stages
in 4 seconds
#Vagrant.require_version ">= 1.7.0"
Vagrant.configure(2) do |config|
config.vm.box = "debian/buster64"
config.vm.provider "virtualbox" do |v|
v.memory = 4196
v.cpus = 2
end
config.vm.provision "bootstrap_ready", type: "ansible" do |ansible|
ansible.playbook = "allgo.yml"
ansible.verbose = true
end
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
end
#Vagrant.require_version ">= 1.7.0"
Vagrant.configure(2) do |config|
config.vm.box = "debian/buster64"
config.vm.provider "virtualbox" do |v|
v.memory = 4196
v.cpus = 2
end
config.vm.provision "bootstrap_ready", type: "ansible" do |ansible|
ansible.playbook = "allgo.yml"
ansible.verbose = true
end
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
end
#Vagrant.require_version ">= 1.7.0"
Vagrant.configure(2) do |config|
config.vm.box = "debian/buster64"
config.vm.provider "virtualbox" do |v|
v.memory = 6144
v.cpus = 4
end
config.vm.provision "bootstrap_ready", type: "ansible" do |ansible|
ansible.playbook = "allgo.yml"
ansible.verbose = true
end
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
end
---
- name: Install Docker on the VM
import_playbook: install_docker.yml
- hosts: all
tasks:
- name: Test whoami
remote_user: vagrant
shell: whoami
register: whoami_output
- debug:
msg: "{{ whoami_output }}"
- name: Cloning AllGo repository
git:
repo: 'https://gitlab.inria.fr/allgo/allgo.git'
dest: /home/vagrant/allgo
- name: Create /data/dev and make it owned by the developer
file: path=/data/dev state=directory owner=vagrant
become: true
- name: Execute the UNAME command
shell: uname -a
register: uname_output
- set_fact: # Set host facts from a task
uname: "{{ uname_output }}"
- debug:
msg: "{{ uname.stdout_lines | list }}"
- name: Test Docker
#shell: sudo docker run hello-world # <-- OK
shell: docker run hello-world
register: docker_run_output
- debug:
msg: "{{ docker_run_output }}"
# - name: Start dev-redis
# command: ./bootstrap dev-redis
# args:
# chdir: /home/vagrant/allgo/
- name: remove /dev/mysql
command: rm -rf /dev/data/mysql
args:
chdir: /home/vagrant/allgo/
# - name: Start dev-controller
# command: ./bootstrap dev-controller
# args:
# chdir: /home/vagrant/allgo/
# - name: Start dev-ssh
# command: ./bootstrap dev-ssh
# args:
# chdir: /home/vagrant/allgo/
- name: Start all
command: ./bootstrap
args:
chdir: /home/vagrant/allgo/
# - name: Start dev-smtpsink
# command: ./bootstrap dev-smtpsink
# args:
# chdir: /home/vagrant/allgo/
# - name: Start dev-registry
# command: ./bootstrap dev-registry
# args:
# chdir: /home/vagrant/allgo/
# - name: Start dev-nginx
# command: ./bootstrap dev-nginx
# args:
# chdir: /home/vagrant/allgo/
# - name: Start dev-toolbox
# command: ./bootstrap dev-toolbox
# args:
# chdir: /home/vagrant/allgo/
#CONTAINERS="dev-redis dev-mysql dev-controller dev-ssh
# dev-django dev-smtpsink dev-registry dev-nginx dev-toolbox"
# ./bootstrap dev-mysql dev-django
[defaults]
transport = ssh
[ssh_connection]
ssh_args = -o ForwardAgent=yes -o StrictHostKeyChecking=no
#!/bin/sh -v
# Nettoyage d'un conteneur vagrand pour allgo
vagrant destroy -f
- hosts: all
become: true
roles:
- geerlingguy.docker
tasks:
- name: Update and upgrade apt packages
become: true
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 86400 #One day
- name: Add the user vagrant to the 'docker' group
user:
name: vagrant
group: docker
become: true
- name: Reset ssh connection to allow previous change to be working
meta: reset_connection
- name: Install vim
apt:
name: vim
- name: Install htop
apt:
name: htop
[qualif]
allgo-dev ansible_ssh_host=127.0.0.1 ansible_ssh_port=2201 ansible_ssh_user='vagrant' ansible_ssh_private_key_file='/Users/cdeltel/TRAVAIL/EQ-SED/AllGo/allgo-vagrant-v1/.vagrant/machines/default/virtualbox/private_key'
#!/bin/sh -v
# Lancement d'un conteneur vagrand pour allgo
# ___________________________ STEP 1 ______________________________________________________
brew upgrade; brew update
# ___________________________ STEP 2 ______________________________________________________
brew install ansible docker-compose
# ___________________________ STEP 3 ______________________________________________________
brew cask install vagrant
# ___________________________ STEP 4 ______________________________________________________
ansible-galaxy install geerlingguy.docker
# ___________________________ STEP 5 ______________________________________________________
#vagrant init
# ___________________________ STEP 6 ______________________________________________________
#vagrant destroy -f
# ___________________________ STEP 7 ______________________________________________________
# Check CPU numbers
if [[ $(sysctl -a | grep "machdep.cpu.core_count: 4") ]]; then
cp Vagrantfile-2CPU Vagrantfile
else
cp Vagrantfile-4CPU Vagrantfile
fi
vagrant up
# ___________________________ STEP 8 ______________________________________________________
bash ssh_tunnel.sh& sleep 10; open https://localhost:8443/
# ssh a la main
# !!__id_file__!! cat /tmp/ssh-config | grep IdentityFile | awk '{print $2}'
ssh -p 2222 -i !!__id_file__!! vagrant@localhost
#!/bin/bash
set -x
lsof -ti:8443 | xargs kill -9
ssh_config=$(vagrant ssh-config > /tmp/ssh-config)
port=$(cat /tmp/ssh-config | grep Port | awk '{print $2}')
identity=$(cat /tmp/ssh-config | grep IdentityFile | awk '{print $2}')
local_port=8443
distant_port=443
ssh -N -p $port -i $identity vagrant@localhost -L $local_port:localhost:$distant_port
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment