SlideShare a Scribd company logo
Local Development
Environments
Vagrant, VirtualBox, and Ansible

Jeff Geerling
Prepackaged environments
•

Traditional prepackaged development stacks:
•

Apache, MySQL, PHP (WAMP/MAMP)

•

Java/Tomcat

•

Ruby/Rails
Prepackaged environments
•

Difficulties:
•

Real-world environments are more complex

•

Single stack for multiple/different projects

•

Prod server differences cause bugs

•

Hard to configure

•

“Snowflakes”
WAMP/MAMP/non-VM
“But it works on my
machine!”
(we’re going to solve this problem)
VM-based development
•

VM (Virtual Machine):
•

Match prod closely

•

Configure to heart’s content

•

Destroy and rebuild if broken

•

BUT, annoying to hand-configure
(not an out-of-the-box solution)

+

+

+
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Vagrant
•

Created to solve difficulties of VM-based
development

•

Bring up, destroy, rebuild VMs with ease

•

Simple Ruby configuration file (Vagrantfile)

•

Can define single-server or multi-server
production-like environments
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Ansible
•

Born out of frustration with complexities and
limitations of existing CM solutions like Puppet

•

“A powerful automation engine that makes
systems and apps simple to deploy. No more
scripting. No custom code. No agents required.
Just get in and get it done.”

•

Easy idempotence <— I like!
Simple, Repeatable VMs

+

+

(or)
- shell scripts
- puppet
- chef
- salt
Let’s see how this works
•

We’re going to:
•

Create a 64-bit CentOS 6.4 VM with Vagrant

•

Configure the VM with Ansible

•

Run the VM inside VirtualBox
(all free and open source, by the way…)
Notes on Windows
•

Preference for POSIX-based systems (OS X, Linux,
etc.)… since that’s where everything is deployed
anyways

•

Windows sometimes often requires hand-holding

•

Example: Ansible doesn’t run (easily) on Windows,
so it’s run from within VM.

•

Shared folders are slow. Might need to us
CIFS/Samba on Windows (similar to NFS on
Mac/Linux).
Getting Started
•

Install VirtualBox

•

Install Vagrant

•

Install Ansible:
$ sudo pip install ansible

(like I said, difficult on Windows, even with Cygwin)
Build a CentOS VM
$ vagrant box add centos64 <url>
$ vagrant init centos64
$ vagrant up
• Done!
Provision the VM
• Add

to the Vagrantfile that was just created:

config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
ansible.sudo = true
end

• Then

create playbook.yml:

--- hosts: all
tasks:
- yum: pkg=httpd state=installed
Provision the VM
•

To run the provisioner:

vagrant provision

•

Done!
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Slightly More Realistic
--# Configure basic CentOS LAMP stack.
- hosts: all
tasks:
- name: Install Dependencies.
yum: src={{ items }} state=installed
with_items:
- httpd
- mysql
- mysql-server
- php
- php-common
- etc…
- name: Copy Apache configuration file.
template: src=templates/httpd.conf dest=/etc/httpd/httpd.conf
- name: Ensure Apache is running and starts at boot.
service: name=httpd state=started enabled=yes
Provisioning on Windows
•

Shell script provisioning works on Windows

•

Use shell script to set up Ansible dependencies,
then run Ansible playbook from within VM:

config.vm.provision "shell" do |sh|
sh.path = "windows.sh"
sh.args = "playbook.yml inventory"
end
•

Since it’s Ruby, you can use ruby if/else for which
provisioner to use, with RbConfig::CONFIG['host_os']
Provisioning on Windows

•

See: Running Ansible within Windows

•

See: JJG-Ansible-Windows
Resources
•

Ansible documentation

•

Vagrant documentation

•

Ansible for Devops (book in progress)
Ad

More Related Content

What's hot (20)

Mini Project PPT
Mini Project PPTMini Project PPT
Mini Project PPT
Faiz Ahmad Khan
 
My Resume final infosys(border photo)
My Resume final infosys(border photo)My Resume final infosys(border photo)
My Resume final infosys(border photo)
ABINASH abinashsahoo484
 
Kompüterin daxili yaddaş qurğuları-Aysun Həsənova.pptx
Kompüterin daxili yaddaş qurğuları-Aysun Həsənova.pptxKompüterin daxili yaddaş qurğuları-Aysun Həsənova.pptx
Kompüterin daxili yaddaş qurğuları-Aysun Həsənova.pptx
aysunhasanova41
 
College Management System project
College Management System projectCollege Management System project
College Management System project
Manish Kushwaha
 
Motion detection system
Motion detection systemMotion detection system
Motion detection system
WritingHubUK
 
Srs example(1)
Srs example(1)Srs example(1)
Srs example(1)
zozila
 
Online student management system
Online student management systemOnline student management system
Online student management system
Mumbai Academisc
 
The library management system
The library management systemThe library management system
The library management system
Munem Shahrear
 
Epharmacy: Online Medicine Shop Management System
Epharmacy: Online Medicine Shop Management SystemEpharmacy: Online Medicine Shop Management System
Epharmacy: Online Medicine Shop Management System
Shahriar Fahim
 
Library Management System Project in C
Library Management System Project in CLibrary Management System Project in C
Library Management System Project in C
codewithc
 
Software requirements specification of Library Management System
Software requirements specification of Library Management SystemSoftware requirements specification of Library Management System
Software requirements specification of Library Management System
Soumili Sen
 
Library management sytem
Library management sytemLibrary management sytem
Library management sytem
ashu6
 
Software requirement specification
Software requirement specificationSoftware requirement specification
Software requirement specification
Ravi Yasas
 
Software requirements specification (srs) by Dan Dharma
Software requirements specification (srs) by  Dan DharmaSoftware requirements specification (srs) by  Dan Dharma
Software requirements specification (srs) by Dan Dharma
Avudaiappan Dharma Ph.D.,
 
Srs for project
Srs for projectSrs for project
Srs for project
Guru Nanak Dev Engineering College, Ludhiana
 
Library management system
Library management systemLibrary management system
Library management system
Arman Ahmed
 
Alumni Management System
Alumni Management SystemAlumni Management System
Alumni Management System
sneha indulkar
 
Shop management system
Shop management systemShop management system
Shop management system
BUBT
 
Final Project Report of College Management System
Final Project Report of College Management SystemFinal Project Report of College Management System
Final Project Report of College Management System
MuhammadHusnainRaza
 
Project report - Web Browser in Java by Devansh Koolwal
Project report - Web Browser in Java by Devansh KoolwalProject report - Web Browser in Java by Devansh Koolwal
Project report - Web Browser in Java by Devansh Koolwal
Devansh Koolwal
 
Kompüterin daxili yaddaş qurğuları-Aysun Həsənova.pptx
Kompüterin daxili yaddaş qurğuları-Aysun Həsənova.pptxKompüterin daxili yaddaş qurğuları-Aysun Həsənova.pptx
Kompüterin daxili yaddaş qurğuları-Aysun Həsənova.pptx
aysunhasanova41
 
College Management System project
College Management System projectCollege Management System project
College Management System project
Manish Kushwaha
 
Motion detection system
Motion detection systemMotion detection system
Motion detection system
WritingHubUK
 
Srs example(1)
Srs example(1)Srs example(1)
Srs example(1)
zozila
 
Online student management system
Online student management systemOnline student management system
Online student management system
Mumbai Academisc
 
The library management system
The library management systemThe library management system
The library management system
Munem Shahrear
 
Epharmacy: Online Medicine Shop Management System
Epharmacy: Online Medicine Shop Management SystemEpharmacy: Online Medicine Shop Management System
Epharmacy: Online Medicine Shop Management System
Shahriar Fahim
 
Library Management System Project in C
Library Management System Project in CLibrary Management System Project in C
Library Management System Project in C
codewithc
 
Software requirements specification of Library Management System
Software requirements specification of Library Management SystemSoftware requirements specification of Library Management System
Software requirements specification of Library Management System
Soumili Sen
 
Library management sytem
Library management sytemLibrary management sytem
Library management sytem
ashu6
 
Software requirement specification
Software requirement specificationSoftware requirement specification
Software requirement specification
Ravi Yasas
 
Software requirements specification (srs) by Dan Dharma
Software requirements specification (srs) by  Dan DharmaSoftware requirements specification (srs) by  Dan Dharma
Software requirements specification (srs) by Dan Dharma
Avudaiappan Dharma Ph.D.,
 
Library management system
Library management systemLibrary management system
Library management system
Arman Ahmed
 
Alumni Management System
Alumni Management SystemAlumni Management System
Alumni Management System
sneha indulkar
 
Shop management system
Shop management systemShop management system
Shop management system
BUBT
 
Final Project Report of College Management System
Final Project Report of College Management SystemFinal Project Report of College Management System
Final Project Report of College Management System
MuhammadHusnainRaza
 
Project report - Web Browser in Java by Devansh Koolwal
Project report - Web Browser in Java by Devansh KoolwalProject report - Web Browser in Java by Devansh Koolwal
Project report - Web Browser in Java by Devansh Koolwal
Devansh Koolwal
 

Viewers also liked (20)

Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
John Lynch
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
bcoca
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
Robert Reiz
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
Martin Etmajer
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
Jeff Geerling
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
Stephane Manciot
 
Getting Started with Drupal VM
Getting Started with Drupal VMGetting Started with Drupal VM
Getting Started with Drupal VM
OPIN Software Inc.
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansible
bcoca
 
Ansible module development 101
Ansible module development 101Ansible module development 101
Ansible module development 101
yfauser
 
Debugging ansible modules
Debugging ansible modulesDebugging ansible modules
Debugging ansible modules
aleonhardt
 
helloTux 2012
helloTux 2012helloTux 2012
helloTux 2012
Chu-Siang Lai
 
歡迎來到 Ubuntu 9.10 Release Party (台中)
歡迎來到 Ubuntu 9.10 Release Party (台中)歡迎來到 Ubuntu 9.10 Release Party (台中)
歡迎來到 Ubuntu 9.10 Release Party (台中)
Chu-Siang Lai
 
Git and Github basic with SourceTree
Git and Github basic with SourceTreeGit and Github basic with SourceTree
Git and Github basic with SourceTree
Chu-Siang Lai
 
無痛入門 Chromecast
無痛入門 Chromecast無痛入門 Chromecast
無痛入門 Chromecast
Chu-Siang Lai
 
使用 Multi-sites 技術快速建置多 Drupal 網站
使用 Multi-sites 技術快速建置多 Drupal 網站使用 Multi-sites 技術快速建置多 Drupal 網站
使用 Multi-sites 技術快速建置多 Drupal 網站
Chu-Siang Lai
 
Unity & Googlizer
Unity & GooglizerUnity & Googlizer
Unity & Googlizer
Chu-Siang Lai
 
Ceph Day Chicago - Ceph Deployment at Target: Best Practices and Lessons Learned
Ceph Day Chicago - Ceph Deployment at Target: Best Practices and Lessons LearnedCeph Day Chicago - Ceph Deployment at Target: Best Practices and Lessons Learned
Ceph Day Chicago - Ceph Deployment at Target: Best Practices and Lessons Learned
Ceph Community
 
Unknown Unicast Traffic and Ping Pollers
Unknown Unicast Traffic and Ping PollersUnknown Unicast Traffic and Ping Pollers
Unknown Unicast Traffic and Ping Pollers
APNIC
 
IPv6 Readiness Measurement BoF Report
IPv6 Readiness Measurement BoF ReportIPv6 Readiness Measurement BoF Report
IPv6 Readiness Measurement BoF Report
APNIC
 
APRICOT 2017 conference network
APRICOT 2017 conference networkAPRICOT 2017 conference network
APRICOT 2017 conference network
APNIC
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
John Lynch
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
bcoca
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
Robert Reiz
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
Martin Etmajer
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
Jeff Geerling
 
Getting Started with Drupal VM
Getting Started with Drupal VMGetting Started with Drupal VM
Getting Started with Drupal VM
OPIN Software Inc.
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansible
bcoca
 
Ansible module development 101
Ansible module development 101Ansible module development 101
Ansible module development 101
yfauser
 
Debugging ansible modules
Debugging ansible modulesDebugging ansible modules
Debugging ansible modules
aleonhardt
 
歡迎來到 Ubuntu 9.10 Release Party (台中)
歡迎來到 Ubuntu 9.10 Release Party (台中)歡迎來到 Ubuntu 9.10 Release Party (台中)
歡迎來到 Ubuntu 9.10 Release Party (台中)
Chu-Siang Lai
 
Git and Github basic with SourceTree
Git and Github basic with SourceTreeGit and Github basic with SourceTree
Git and Github basic with SourceTree
Chu-Siang Lai
 
無痛入門 Chromecast
無痛入門 Chromecast無痛入門 Chromecast
無痛入門 Chromecast
Chu-Siang Lai
 
使用 Multi-sites 技術快速建置多 Drupal 網站
使用 Multi-sites 技術快速建置多 Drupal 網站使用 Multi-sites 技術快速建置多 Drupal 網站
使用 Multi-sites 技術快速建置多 Drupal 網站
Chu-Siang Lai
 
Ceph Day Chicago - Ceph Deployment at Target: Best Practices and Lessons Learned
Ceph Day Chicago - Ceph Deployment at Target: Best Practices and Lessons LearnedCeph Day Chicago - Ceph Deployment at Target: Best Practices and Lessons Learned
Ceph Day Chicago - Ceph Deployment at Target: Best Practices and Lessons Learned
Ceph Community
 
Unknown Unicast Traffic and Ping Pollers
Unknown Unicast Traffic and Ping PollersUnknown Unicast Traffic and Ping Pollers
Unknown Unicast Traffic and Ping Pollers
APNIC
 
IPv6 Readiness Measurement BoF Report
IPv6 Readiness Measurement BoF ReportIPv6 Readiness Measurement BoF Report
IPv6 Readiness Measurement BoF Report
APNIC
 
APRICOT 2017 conference network
APRICOT 2017 conference networkAPRICOT 2017 conference network
APRICOT 2017 conference network
APNIC
 
Ad

Similar to Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible (20)

Fake IT, until you make IT
Fake IT, until you make ITFake IT, until you make IT
Fake IT, until you make IT
Bas Meijer
 
Making development environments not suck | #econfpsu #econfpsu16
Making development environments not suck | #econfpsu #econfpsu16Making development environments not suck | #econfpsu #econfpsu16
Making development environments not suck | #econfpsu #econfpsu16
Tim Bracken
 
Improved development workflows using vagrant
Improved development workflows using vagrantImproved development workflows using vagrant
Improved development workflows using vagrant
Makis Asimidis
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual Infrastructure
Bryan McLellan
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
John Rofrano
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
Crifkin
 
VMware studio practice in TIM
VMware studio practice in TIMVMware studio practice in TIM
VMware studio practice in TIM
Yi-Huan Chan
 
Erlang on OSv
Erlang on OSvErlang on OSv
Erlang on OSv
Zvi Avraham
 
快快樂樂用Homestead
快快樂樂用Homestead快快樂樂用Homestead
快快樂樂用Homestead
Chen Cheng-Wei
 
Setting up a local WordPress development environment
Setting up a local WordPress development environmentSetting up a local WordPress development environment
Setting up a local WordPress development environment
Zero Point Development
 
Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
Oscar Merida
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
Dave Pitts
 
Developing Locally with WordPress: No More Cowboy Coding
Developing Locally with WordPress: No More Cowboy CodingDeveloping Locally with WordPress: No More Cowboy Coding
Developing Locally with WordPress: No More Cowboy Coding
Matt Banks
 
Local development environment through virtualisation
Local development environment through virtualisationLocal development environment through virtualisation
Local development environment through virtualisation
Radu Barbu
 
Vagrant
Vagrant Vagrant
Vagrant
Akshay Siwal
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Hendrik Ebbers
 
Using Vagrant
Using VagrantUsing Vagrant
Using Vagrant
andygale
 
Small Python Tools for Software Release Engineering
Small Python Tools for Software Release EngineeringSmall Python Tools for Software Release Engineering
Small Python Tools for Software Release Engineering
pycontw
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrant
andygale
 
Fake IT, until you make IT
Fake IT, until you make ITFake IT, until you make IT
Fake IT, until you make IT
Bas Meijer
 
Making development environments not suck | #econfpsu #econfpsu16
Making development environments not suck | #econfpsu #econfpsu16Making development environments not suck | #econfpsu #econfpsu16
Making development environments not suck | #econfpsu #econfpsu16
Tim Bracken
 
Improved development workflows using vagrant
Improved development workflows using vagrantImproved development workflows using vagrant
Improved development workflows using vagrant
Makis Asimidis
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual Infrastructure
Bryan McLellan
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
John Rofrano
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
Crifkin
 
VMware studio practice in TIM
VMware studio practice in TIMVMware studio practice in TIM
VMware studio practice in TIM
Yi-Huan Chan
 
快快樂樂用Homestead
快快樂樂用Homestead快快樂樂用Homestead
快快樂樂用Homestead
Chen Cheng-Wei
 
Setting up a local WordPress development environment
Setting up a local WordPress development environmentSetting up a local WordPress development environment
Setting up a local WordPress development environment
Zero Point Development
 
Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
Oscar Merida
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
Dave Pitts
 
Developing Locally with WordPress: No More Cowboy Coding
Developing Locally with WordPress: No More Cowboy CodingDeveloping Locally with WordPress: No More Cowboy Coding
Developing Locally with WordPress: No More Cowboy Coding
Matt Banks
 
Local development environment through virtualisation
Local development environment through virtualisationLocal development environment through virtualisation
Local development environment through virtualisation
Radu Barbu
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Hendrik Ebbers
 
Using Vagrant
Using VagrantUsing Vagrant
Using Vagrant
andygale
 
Small Python Tools for Software Release Engineering
Small Python Tools for Software Release EngineeringSmall Python Tools for Software Release Engineering
Small Python Tools for Software Release Engineering
pycontw
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrant
andygale
 
Ad

More from Jeff Geerling (20)

Continuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub ActionsContinuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub Actions
Jeff Geerling
 
2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly
Jeff Geerling
 
There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)
Jeff Geerling
 
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi clusterEverything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Jeff Geerling
 
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 KeynoteReal World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Jeff Geerling
 
Make your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalableMake your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalable
Jeff Geerling
 
Ansible and Kubernetes
Ansible and KubernetesAnsible and Kubernetes
Ansible and Kubernetes
Jeff Geerling
 
HTTPS and Ansible
HTTPS and AnsibleHTTPS and Ansible
HTTPS and Ansible
Jeff Geerling
 
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Jeff Geerling
 
Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017
Jeff Geerling
 
ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home
Jeff Geerling
 
Highly available Drupal on a Raspberry Pi cluster
Highly available Drupal on a Raspberry Pi clusterHighly available Drupal on a Raspberry Pi cluster
Highly available Drupal on a Raspberry Pi cluster
Jeff Geerling
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2
Jeff Geerling
 
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
Jeff Geerling
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
Jeff Geerling
 
Ansible for Drupal infrastructure and deployments
Ansible for Drupal infrastructure and deploymentsAnsible for Drupal infrastructure and deployments
Ansible for Drupal infrastructure and deployments
Jeff Geerling
 
Ansible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps MatchAnsible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps Match
Jeff Geerling
 
Drupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionDrupal 8 - A Brief Introduction
Drupal 8 - A Brief Introduction
Jeff Geerling
 
Server Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.jsServer Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.js
Jeff Geerling
 
Florissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys RedevelopmentFlorissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys Redevelopment
Jeff Geerling
 
Continuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub ActionsContinuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub Actions
Jeff Geerling
 
2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly
Jeff Geerling
 
There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)
Jeff Geerling
 
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi clusterEverything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Jeff Geerling
 
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 KeynoteReal World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Jeff Geerling
 
Make your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalableMake your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalable
Jeff Geerling
 
Ansible and Kubernetes
Ansible and KubernetesAnsible and Kubernetes
Ansible and Kubernetes
Jeff Geerling
 
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Jeff Geerling
 
Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017
Jeff Geerling
 
ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home
Jeff Geerling
 
Highly available Drupal on a Raspberry Pi cluster
Highly available Drupal on a Raspberry Pi clusterHighly available Drupal on a Raspberry Pi cluster
Highly available Drupal on a Raspberry Pi cluster
Jeff Geerling
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2
Jeff Geerling
 
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
Jeff Geerling
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
Jeff Geerling
 
Ansible for Drupal infrastructure and deployments
Ansible for Drupal infrastructure and deploymentsAnsible for Drupal infrastructure and deployments
Ansible for Drupal infrastructure and deployments
Jeff Geerling
 
Ansible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps MatchAnsible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps Match
Jeff Geerling
 
Drupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionDrupal 8 - A Brief Introduction
Drupal 8 - A Brief Introduction
Jeff Geerling
 
Server Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.jsServer Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.js
Jeff Geerling
 
Florissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys RedevelopmentFlorissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys Redevelopment
Jeff Geerling
 

Recently uploaded (20)

Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 

Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible

  • 2. Prepackaged environments • Traditional prepackaged development stacks: • Apache, MySQL, PHP (WAMP/MAMP) • Java/Tomcat • Ruby/Rails
  • 3. Prepackaged environments • Difficulties: • Real-world environments are more complex • Single stack for multiple/different projects • Prod server differences cause bugs • Hard to configure • “Snowflakes”
  • 4. WAMP/MAMP/non-VM “But it works on my machine!” (we’re going to solve this problem)
  • 5. VM-based development • VM (Virtual Machine): • Match prod closely • Configure to heart’s content • Destroy and rebuild if broken • BUT, annoying to hand-configure (not an out-of-the-box solution) + + +
  • 7. Vagrant • Created to solve difficulties of VM-based development • Bring up, destroy, rebuild VMs with ease • Simple Ruby configuration file (Vagrantfile) • Can define single-server or multi-server production-like environments
  • 9. Ansible • Born out of frustration with complexities and limitations of existing CM solutions like Puppet • “A powerful automation engine that makes systems and apps simple to deploy. No more scripting. No custom code. No agents required. Just get in and get it done.” • Easy idempotence <— I like!
  • 10. Simple, Repeatable VMs + + (or) - shell scripts - puppet - chef - salt
  • 11. Let’s see how this works • We’re going to: • Create a 64-bit CentOS 6.4 VM with Vagrant • Configure the VM with Ansible • Run the VM inside VirtualBox (all free and open source, by the way…)
  • 12. Notes on Windows • Preference for POSIX-based systems (OS X, Linux, etc.)… since that’s where everything is deployed anyways • Windows sometimes often requires hand-holding • Example: Ansible doesn’t run (easily) on Windows, so it’s run from within VM. • Shared folders are slow. Might need to us CIFS/Samba on Windows (similar to NFS on Mac/Linux).
  • 13. Getting Started • Install VirtualBox • Install Vagrant • Install Ansible: $ sudo pip install ansible (like I said, difficult on Windows, even with Cygwin)
  • 14. Build a CentOS VM $ vagrant box add centos64 <url> $ vagrant init centos64 $ vagrant up • Done!
  • 15. Provision the VM • Add to the Vagrantfile that was just created: config.vm.provision "ansible" do |ansible| ansible.playbook = "playbook.yml" ansible.sudo = true end • Then create playbook.yml: --- hosts: all tasks: - yum: pkg=httpd state=installed
  • 16. Provision the VM • To run the provisioner: vagrant provision • Done!
  • 18. Slightly More Realistic --# Configure basic CentOS LAMP stack. - hosts: all tasks: - name: Install Dependencies. yum: src={{ items }} state=installed with_items: - httpd - mysql - mysql-server - php - php-common - etc… - name: Copy Apache configuration file. template: src=templates/httpd.conf dest=/etc/httpd/httpd.conf - name: Ensure Apache is running and starts at boot. service: name=httpd state=started enabled=yes
  • 19. Provisioning on Windows • Shell script provisioning works on Windows • Use shell script to set up Ansible dependencies, then run Ansible playbook from within VM: config.vm.provision "shell" do |sh| sh.path = "windows.sh" sh.args = "playbook.yml inventory" end • Since it’s Ruby, you can use ruby if/else for which provisioner to use, with RbConfig::CONFIG['host_os']
  • 20. Provisioning on Windows • See: Running Ansible within Windows • See: JJG-Ansible-Windows