diff --git a/content/slides/cri/images/vagrant.png b/content/slides/cri/images/vagrant.png new file mode 100644 index 0000000000000000000000000000000000000000..4e79017b18b9c385bc519b3a252c87dbea90b288 Binary files /dev/null and b/content/slides/cri/images/vagrant.png differ diff --git a/content/slides/cri/md/vagrant.md b/content/slides/cri/md/vagrant.md new file mode 100644 index 0000000000000000000000000000000000000000..bad6cb91b214de39b7d28af6bf647fc4be9e51c6 --- /dev/null +++ b/content/slides/cri/md/vagrant.md @@ -0,0 +1,128 @@ +# vagrant + +<!-- .element width="30%" --> + +**By HashiCorp** + + +## vagrant + +* création / configuration d'environnements virtuels + +* écrit en ruby +* [<i class="fa fa-github" aria-hidden="true"></i> hashicorp/vagrant](https://github.com/hashicorp/vagrant) + * [<i class="fa fa-gavel" aria-hidden="true"></i> The MIT Licens](https://github.com/hashicorp/vagrant/blob/master/LICENSE) + +* outil ligne de commande + * se voit dans l'hyperviseur utilisé + + +## vagrant + +* Il peut être considéré comme un wrapper d'hyperviseur + * VirtualBox + * libvirt + * VMware + * Amazon EC2 +* supporte nativement docker depuis la 1.6 + + +## Installation + +* gem + gem install vagrant +* system + + +## Initialisation du projet + +``` +mkdir project && cd project +vagrant init +``` + +génère un Vagrantfile + +``` +Vagrant.configure("2") do |config| + config.vm.box = "base" +end +``` + +Beaucoup de commentaires ... laisser vous guidez + + +## Box + +* Machines virtuelles préconfigurées (templates) +* [vagrant cloud](https://app.vagrantup.com/boxes/search) +* [vagrantbox.es](https://www.vagrantbox.es/) +* mis en cache +* nommage à la github "développeur/Box" + +``` +vagrant box add "ubuntu/xenial64" +vagrant box add "http://aka.ms/vagrant-win7-ie11" +vagrant box list +vagrant box remove "ubuntu/xenial64" +``` +* [Creating a Base Box](https://www.vagrantup.com/docs/boxes/base.html) + * [<i class="fa fa-github" aria-hidden="true"></i> veewee](https://github.com/jedi4ever/veewee) + * [<i class="fa fa-github" aria-hidden="true"></i> How to Create a CentOS Vagrant Base Box](https://github.com/ckan/ckan/wiki/How-to-Create-a-CentOS-Vagrant-Base-Box) + + +## Premier pas + +``` +vagrant up #--provider=virtualbox +vagrant ssh +vagrant halt +vagrant suspend +vagrant reload +vagrant destroy #--force +``` + + +## shared folders + +$ ll /vagrant + +montage automatique de . + +autre possibilité à parir du vagrant file + +config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig" + + +## provisioning + +via un simple script + +``` +Vagrant.configure("2") do |config| + config.vm.box = "hashicorp/precise32" + config.vm.provision "shell", path: "script.sh" +end +``` + + +## provisioning + +via [ansible](ansible.html) + +``` +Vagrant.configure("2") do |config| + config.vm.box = "hashicorp/precise32" + config.vm.provision "shell", path: "script.sh" + + config.vm.provision "ansible" do |ansible| + ansible.playbook = "playbook.yml" + end +end +``` + +### idéal pour tester les playbooks + +## mapping de port + +## vagrant pour tester apache diff --git a/content/slides/cri/vagrant.html b/content/slides/cri/vagrant.html new file mode 100644 index 0000000000000000000000000000000000000000..2ae6dc01ba27097fe73ec3e0925133b26a9c2b75 --- /dev/null +++ b/content/slides/cri/vagrant.html @@ -0,0 +1,59 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> + + <title>vagrant</title> + + <link rel="stylesheet" href="../../node_modules/reveal.js/css/reveal.css"> + <link rel="stylesheet" href="../../node_modules/reveal.js/css/theme/white.css"> + + <!-- Theme used for syntax highlighting of code --> + <link rel="stylesheet" href="../../node_modules/reveal.js/lib/css/zenburn.css"> + <link rel="stylesheet" href="../../node_modules/font-awesome/css/font-awesome.min.css"> + <link rel="stylesheet" href="../main.css"> + + <!-- Printing and PDF exports --> + <script> + var link = document.createElement( 'link' ); + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = window.location.search.match( /print-pdf/gi ) ? '../../node_modules/reveal.js/css/print/pdf.css' : '../../node_modules/reveal.js/css/print/paper.css'; + document.getElementsByTagName( 'head' )[0].appendChild( link ); + </script> + </head> + <body> + <div class="reveal"> + <div class="slides"> + <section data-markdown="md/vagrant.md" + data-separator="^\n\n\n" + data-separator-vertical="^\n\n" + data-separator-notes="^Note:" + data-charset="utf-8"> + </section> + </div> + </div> + + <script src="../../node_modules/reveal.js/lib/js/head.min.js"></script> + <script src="../../node_modules/reveal.js/js/reveal.js"></script> + + <script> + // More info about config & dependencies: + // - https://github.com/hakimel/reveal.js#configuration + // - https://github.com/hakimel/reveal.js#dependencies + Reveal.initialize({ + controls: true, + progress: true, + history: true, + center: false, + dependencies: [ + { src: '../../node_modules/reveal.js/plugin/markdown/marked.js' }, + { src: '../../node_modules/reveal.js/plugin/markdown/markdown.js' }, + { src: '../../node_modules/reveal.js/plugin/notes/notes.js', async: true }, + { src: '../../node_modules/reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } } + ] + }); + </script> + </body> +</html> diff --git a/content/slides/index.html b/content/slides/index.html index 058d0bd4e2d78481a89e628bf614b038ff06f524..75af1ca2e3e88c674ed2ef17c0254806dbce42f9 100644 --- a/content/slides/index.html +++ b/content/slides/index.html @@ -70,6 +70,7 @@ <li><a href="cri/vault.html">vault</a></li> <li><a href="cri/ansible.html">ansible</a></li> <li><a href="cri/terraform.html">terraform</a></li> +<li><a href="cri/vagrant.html">vagrant</a></li> <li><a href="cri/aws.html">aws</a></li> <h3>privacy</h3>