DevOps
![](http://fhlug.at/logo.png)
What is DevOps?
![](https://devcentral.f5.com/weblogs/images/devcentral_f5_com/weblogs/macvittie/Windows-Live-Writer/Devops-is-Not-All-About-Automation_31BE/blue%20devops_4.png)
![](http://i.imgur.com/IcMP5eZ.gif)
»DevOps is a software development method that stresses communication, collaboration and integration between software developers and IT professionals« - Wikipedia
Application Lifecycle
Develop
Deploy
Maintain
Vagrant
Puppet / Chef
Docker
Capistrano
Consul
Packer
Nagios
Why DevOps?
![](http://media.tumblr.com/d7f588763b2951a40dd48fbe85f76ab4/tumblr_inline_n78ix43xHY1raprkq.gif)
How does DevOps improve our process?
- Reusability
- Automation
- Faster Deploys
- Higher Quality
- Error Reduction
- Shorter Lifecycles
Vagrant
how cats use enterprise development tools for world domination
What is Vagrant?
![](http://www.projectpawsitive.com/wp-content/uploads/2013/08/CAt_No-Background1.png)
![](http://www.westfieldcattery.com/SiteAssets/lordmeowington.png)
![](https://assets.ubuntu.com/sites/ubuntu/latest/u/img/homepage/Dell_XPS_Laptop_Front.png)
![](http://images.apple.com/macbook-pro/images/overview_display_hero.jpg)
![](http://www.liquidpixels.com/images/icon-success.png)
![](http://www.liquidpixels.com/images/icon-error.png)
![](https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png)
Applications need ...
- ... their own private environment
- ... certain versions of libraries
- ... configfiles in place
- ... other circumstances
![](http://www.projectpawsitive.com/wp-content/uploads/2013/08/CAt_No-Background1.png)
![](http://www.westfieldcattery.com/SiteAssets/lordmeowington.png)
![](http://www.lenovo.com/images/OneWebImages/Brand/460x368/lenovo-rack-server-thinkserver-rd540-rd640.png)
![](http://www.lenovo.com/images/OneWebImages/Brand/460x368/lenovo-rack-server-thinkserver-rd540-rd640.png)
Virtual
Development Environment
![](http://upload.wikimedia.org/wikipedia/commons/8/87/Vagrant.png)
The Vagrant Approach
git clone
vagrant up
Hands On
git clone https://github.com/doebi/catbook.git
How vagrant works.
![](http://files.softicons.com/download/system-icons/box-icons-by-bjorn-lindberg/png/256x256/linux%20box.png)
![](http://4vector.com/i/free-vector-text-file-icon_101919_Text_File_Icon.png)
![](http://upload.wikimedia.org/wikipedia/commons/d/d5/Virtualbox_logo.png)
base box
Vagrantfile
Provider
![](http://files.softicons.com/download/system-icons/box-icons-by-bjorn-lindberg/png/256x256/windows%20box.png)
![](http://4vector.com/i/free-vector-text-file-icon_101919_Text_File_Icon.png)
![](http://www.dfit.com.au/wp-content/uploads/2013/03/VMware-Certified.png)
vagrant boxes
https://vagrantcloud.com/
![](https://hashicorp.com/images/blog/vagrant-cloud-5-weeks-in/logo-side-95bdf2d5.png)
$ vagrant box
vagrant box add ubuntu/trusty32
- add
- list
- outdated
- remove
- repackage
- update
Hands On
vagrant box add fhlug/trusty32
http://fhlug.at/~cd/boxes/trusty32/package.box
$ vagrant init
vagrant init ubuntu/trusty32
initialize a Vagrantfile
Hands On
vagrant init fhlug/trusty32
Vagrantfile
- config file
- ruby
- multiple machines
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty32"
end
$ vagrant up
vagrant up
- boot a VM
- when run for the first time set up and provision according to Vagrantfile
Hands On
vagrant up
$ vagrant ssh
vagrant ssh
connect to a running VM using ssh
$ vagrant rdp
vagrant rdp
connect to a running Windows-VM using rdp
Hands On
vagrant ssh
now mess with your VM, it's desposable! ;)
just run
vagrant destroy and
vagrant up to restore a new one
Synced Folders
Benefits
- use your own IDE/Editor for development
- never loose project files in a corrupt VM
- integrate files in your usual backup strategy or git
Vagrant.configure("2") do |config|
# other config here
config.vm.synced_folder "src/", "/srv/website"
end
Hands On
edit Vagrantfile
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
...
config.vm.synced_folder "../data", "/vagrant_data"
...
end
vagrant up
Provisioning
This is where the magic happens!
Vagrant.configure("2") do |config|
# ... other configuration
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
end
config.vm.provision "shell", inline: "echo Hello, World"
config.vm.provision "shell", path: "script.sh"
config.vm.provision "shell", path: "https://example.com/provisioner.sh"
Hands On
edit Vagrantfile
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
...
config.vm.provision "shell", inline: "echo Hello, Vagrant"
...
end
vagrant provision
Provisioning
Why not use the same scripts as for deployment in production?
![](http://www.linuxuser.co.uk/wp-content/uploads/2010/08/Puppet-logo.png)
![](https://s3.amazonaws.com/opscode-corpsite/assets/121/pic-chef-logo.png)
![](http://www.ansible.com/hs-fs/hub/330046/file-764918161-png/Official_Logos/ansible_logo_black_square.png)
![](https://upload.wikimedia.org/wikipedia/commons/7/79/Docker_(container_engine)_logo.png)
![](http://www.normation.com/wp-content/uploads/2013/11/CFEngine_Logo_small.png)
![](http://vbyron.com/blog/wp-content/uploads/2014/03/saltstack_logo.jpg)
YOU CAN!
Provisioning
Vagrant.configure("2") do |config|
config.vm.provision "puppet" do |puppet|
puppet.manifests_path = "my_manifests"
puppet.manifest_file = "default.pp"
end
end
config.vm.provision "chef_client" do |chef|
chef.chef_server_url = "http://mychefserver.com"
chef.validation_key_path = "validation.pem"
end
config.vm.provision "docker" do |d|
d.build_image "/vagrant/app"
end
Hands On
vagrant destroy
git checkout provision
vagrant up
Vagrant.configure("2") do |config|
config.vm.network "forwarded_port", guest: 80, host: 8080
end
config.vm.network "private_network", type: "dhcp"
config.vm.network "public_network", ip: "192.168.0.17"
Networking
Hands On
edit Vagrantfile
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
...
config.vm.network "forwarded_port", guest: 80, host: 8080
...
end
vagrant reload --provision
vagrant share
sicker shit
vagrant connect
- connect to a generaly shared vagrant VM to have access to all ports
HTTP sharing
SSH sharing
General Sharing
share a VMs HTTP port on a public address
share a VMs SSH port
share any port
now go and vagrantify your projects!
![](https://i.imgur.com/3DRRs5w.png)
Thanks
devopsreactions.tumblr.com
thecodinglove.com
securityreactions.tumblr.com
Vagrant
By doebi
Vagrant
This talk covers all basic techniques of vagrant and shows how project teams can improve their development.
- 3,569