Vagrant Workshop
-
Upload
sys-army -
Category
Engineering
-
view
341 -
download
3
Transcript of Vagrant Workshop
Vagrant Workshopby Eduardo Casarero ([email protected] || @jedux)
vagrant up(TECHNOLOGY) — phrasal verb with vagrant
“just hit vagrant up” and ‘automágicamente’ download the box, unpack it, add it to the box repo, clone it into VirtualBox, start it, provision it and give access to the user.
Who?● Eduardo Casarero (@jedux)● Almost Engineer (UADE)● Sysadmin > 10 years● DevOps <3● #sysarmy (irc, sysarmy/help, adminbirras)● #nerdearla
HashicorpCandy factory for Sysadmins.
Application delivery done right.
HashiCorp delivers pragmatic solutions to maximize developer and operator agility. Build microservice-driven applications that are codified, automated, scalable and secure.
Hashicorp Ecosystem
Hashicorp EcosystemPacker is a HashiCorp tool for creating machine images and deployable artifacts such as AMIs,
OpenStack images, Docker containers, etc.
Terraform is a HashiCorp tool for creating, combining, and modifying infrastructure. In the Atlas
workflow Terraform reads from the artifact registry and provisions infrastructure.
Consul is a HashiCorp tool for service discovery, service registry, and health checks.
Serf is a HashiCorp tool for cluster membership and failure detection.
Vagrant is a HashiCorp tool for managing development environments that mirror production.
Vagrant environments reduce the friction of developing a project and reduce the risk of
unexpected behavior appearing after deployment.
Atlas
BV: Before Vagrant
Pre-Vagrant scenario (real)Use case 1 (easy one):“ASAP test this package/app/config/etc (in a clean environment)”● First approach: use my notebook/desktop
○ my desktop is not a “clean” environment, it’s more like a polluted one.● Second approach: use a virtual machine on virtualbox
○ easy, install from iso in virtualbox, test, destroy vm… too much time to setup.
○ Corporate Virtual Machine “black” market -> not clean environment● Third approach: cd vagrant/ubuntu-server && vagrant up
○ Learn vagrant, created one base box like a production environment○ up -> test -> destroy -> up -> test -> destroy :) :) :) :)
AV: After Vagrant
Vagrant!
Virtualized development environment made easy● command line tool● lowers provisioning time● fully control environment and versions● kills “work on my machine” excuse● many providers: virtualbox, vmware, aws, etc● can use puppet, chef, ansible, bash scripts● FREE and open source
80% of Vagrant
● 5 simple commands:○ vagrant up○ vagrant provision○ vagrant ssh○ vagrant halt○ vagrant destroy
● Really more like 16 commands, but you really use these 5.
Go -> Level 0 & 1Get the workshop environment from https://github.com/edux/vagrant_workshop
Shortfalls of environments
● Does not mirror “testing” or production setup● Each developer has a different one● Easily out of sync with standards● Many versions of php, mysql, java, etc.● High learning curve for new devs/qa/it● ‘works in my computer’ culture.
QA/Dev “Standard” Workstation
Vagrantified environment
Benefits● Solo Developers
○ consistency across multiple projects○ can run multiple environments on a single host (dev, test, staging)○ easy tear down and rebuild
● TEAMS○ identical development environments (kills ‘works on my pc’ excuse)○ consistent and portable
● COMPANIES○ lowering learning curve○ build once, distribute to everyone○ lower costs
Go -> Level 2
Real use case: take 2PM: please fix our “switch to replica” golden scripts.
Need at least 3 servers to test.● Started with only Virtualbox kicking and
snapshotting vms. ● Ended with Vagrant with multi machine
environment -> glory.
Go -> Level 3
Real Use case: take 3
IT team supports almost 60 devs+qa. Everybody “needs” a sandbox environment to play with. ● Sandbox installation installs toooooo many things nginx,
mysql,git,internal tools, log tools, the app, devs tools, qa tools, etc….
● Solution: Vagrantify environment, this is still a work in progress as the use case is “complex”.
(my) Success keys to deploy vagrant● dogfooding is critical (sell what you use)● get support from management (hard one)● rock solid images (users does not like bugs, neither do
we)● prepare images and configs to suit all use cases!!!!● detect early adopters to help you push changes in the
teams
Boxes, boxes, boxes
https://atlas.hashicorp.com/boxes/search
Provisioning like a boss
- Shell- Ansible- CFEngine- Chef- Docker- Puppet- Salt
Go -> Level 4
multi envs with multi vms.
- The dynamic ip challenge.- Hostsmanager- moving that to libvirt with minimal changes:
- network eth names- mem / cpu / other hypervisor parameters.
misc: kali - windows.
- using gui=true.- winrm is available to do configs over
windows hosts.- show modern.ie windows vms for everyone.
(https://dev.modern.ie/)
Go -> Level 5
Cutting edge: Otto
Questions ?
Thanks!!