Daniel Farrell
Software Engineer, Red Hat SDN Team
$ cat Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
end
$ vagrant up
$ vagrant ssh
[vagrant@localhost ~]$
$ VBoxManage createvm <many flags>
[vagrant@localhost ~]$ ping 8.8.8.8
64 bytes from 8.8.8.8: icmp_seq=1 ttl=63 time=36.4 ms
[vagrant@localhost ~]$ ls /vagrant/
Vagrantfile
[vagrant@localhost ~]$ touch /vagrant/foo
[vagrant@localhost ~]$ logout
$ ls
foo Vagrantfile
$ vagrant init -m centos/7
$ cat Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
end
$ vagrant up
# Base box downloads if not cached
# VM boots
# Cross-OS networking magic
# Cross-OS shared dir magic
$ vagrant ssh
[vagrant@localhost ~]$
Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/fedora22"
config.vm.provision "shell", inline: "dnf install -y <system deps>"
end
$ vagrant up
# (networking, mount and other magic)
# Shell provisioner runs, <system deps> are installed
Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/fedora22"
config.vm.provision "ansible" do |ansible|
ansible.playbook = "provisioning/playbook.yml"
end
end
ansible.playbook = "provisioning/playbook.yml"
[~/vagrant-opendaylight]$ cat provisioning/playbook.yml
---
- hosts: all
sudo: yes
roles:
- opendaylight
$ vagrant up
# (networking, mount and other magic)
# Ansible provisioner runs, OpenDaylight is installed
$ vagrant ssh
[vagrant@localhost ~]$ sudo systemctl is-active opendaylight
active
By Daniel Farrell
Introduction to Vagrant lightning talk for All Things Open 2015.