Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathieu Trossevin
blog.limos.fr
Commits
c76bd2b7
Commit
c76bd2b7
authored
Dec 13, 2018
by
Vincent Mazenod
Browse files
add vagrant doc
parent
c856ba56
Changes
4
Hide whitespace changes
Inline
Side-by-side
content/slides/cri/images/vagrant.png
0 → 100644
View file @
c76bd2b7
449 KB
content/slides/cri/md/vagrant.md
0 → 100644
View file @
c76bd2b7
# 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
content/slides/cri/vagrant.html
0 → 100644
View file @
c76bd2b7
<!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>
content/slides/index.html
View file @
c76bd2b7
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment