vagrant - Offirmo-team/wiki GitHub Wiki
Voir aussi VirtualBox, Serveur, puppet, jenkins, docker...
Voir aussi outils liés :
Introduction
"Vagrant is an helper installation program that will create for you a complete configured virtualized server. It uses a simple Ruby file as its configuration in order to produce reproducible images of your server. When you want to send a server to your coworkers, you only send this file. When you want to create a new server with some preinstalled tools, you just edit the configuration file."
-
Intro toute simple : http://pem-musing.blogspot.fr/2014/04/virtualize-your-servers.html
Utilisation
création
mkdir ...
cd ...
vagrant init
Éditer le vagrantfile, puis :
vagrant up
reprovisionner :
vagrant reload --provision
vagrant ssh
vagrant halt
vagrant reload
vagrant destroy
Choisir une box
Ubuntu officielles : https://vagrantcloud.com/ubuntu
vagrantfile
TODO
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
inline bash script
#+ Shell provisionning
#+
$script = <<SCRIPT
# REM : run as root on the vagrant machine
cd /vagrant;
echo "Hello from inline script !"
echo "* current ENV"
echo " - BASH_SUBSHELL = $BASH_SUBSHELL"
echo " - BASH_SOURCE = $BASH_SOURCE"
echo " - whoami = `whoami`"
echo " - pwd = `pwd`"
echo " - LANG = `echo $LANG`"
echo " - LC_ALL = `echo $LC_ALL`"
echo "inline script done !"
SCRIPT
config.vm.provision "shell", inline: $script
provisioning
paquets pour X client
http://doc.ubuntu-fr.org/installation_minimale
sudo apt-get install gdm gnome-core xfonts-base
lancement
http://stackoverflow.com/questions/20094118/ssh-into-vagrant-with-x-server-set-up
vagrant -Y ssh
Avancé
Hyper-V sous Windows
http://docs.vagrantup.com/v2/hyperv/index.html