Commit 060067eb authored by GARNIER Laurent's avatar GARNIER Laurent
Browse files

Add vagrant files

parent 97c942a3
Pipeline #106628 passed with stages
in 5 minutes and 28 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 = 6144
v.cpus = 4
end
config.vm.provision "bootstrap_ready", type: "ansible" do |ansible|
ansible.playbook = "allgo.yml"
ansible.verbose = true
end
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: Start dev-mysql
# command: ./bootstrap dev-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 dev-django
# command: ./bootstrap dev-django
# 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
- 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/bash
set -x
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