SlideShare a Scribd company logo
1 of 11
Ansible & Vagrant
About Me
• Automation enthusiast
• Worked in corporate
environments
• Now co-founder of a small startup
company
Agenda
• Vagrant intro
• Simple LAMP provisioning setup
• Demo of provisioning on virtual box
• Switching vagrant provider to openstack
What is VAGRANT
• https://www.vagrantup.com/
• Manage development environments – up/destroy machines
• Works with different virtualization providers
• “Easy” ruby syntax
• Supports different provisioners
Our Simple LAMP
• Linux – Debian box image
• Apache with PHP and memcached
• MySQL / MariaDB
• Deploy application and load database from
a git repo
Ansible highlights
• apt
• Git
• Templates
- name: ensure apache is installed
apt: name=apache2 state=present
- git: repo=git@github.com/wiki.git dest=/var/www/site/
accept_hostkey=yes
- copy: src=templates/site.conf
dest=/etc/apache2/sites-enabled/site.conf
Ansible highlights
• MySql DB – import
• Notify
- name: create wiki app db
mysql_db: name=wikidb state=import
target=/var/www/site/wikidb.sql
handlers:
- name: restart apache
action: service name=apache2 state=restarted
Vagrant Ansible provisioner
• Pass variables (facts) to the playbook
• Vagrant specific – like IP
config.vm.provision 'ansible' do |ansible|
ansible.playbook = 'ansible/playbook.yml'
ansible.verbose = 'vvv'
ansible.extra_vars = {
ans_vm_priv_ip: vm_priv_ip
}
end
Switch the provider to
OpenStack
vagrant plugin install vagrant-openstack-provider
2. VM is booted
1. Create VM (up)
3. Provision VM over ssh
OpenStack provider
Vagrantfile
config.vm.provider :openstack do |os|
os.openstack_auth_url =ENV['OS_AUTH_URL']
os.tenant_name=ENV['OS_TENANT_NAME']
os.username = ENV['OS_USERNAME']
os.password = ENV['OS_PASSWORD']
os.floating_ip_pool = ENV['OS_FLOATING_IP_POOL']
os.flavor = ENV['OS_FLAVOR']
os.image = ENV['OS_IMAGE']
end
Thank you!
Q&A

More Related Content

What's hot

Perl hosting for beginners - Cluj.pm March 2013
Perl hosting for beginners - Cluj.pm March 2013Perl hosting for beginners - Cluj.pm March 2013
Perl hosting for beginners - Cluj.pm March 2013
Arpad Szasz
 
Scala Vienna Website: reloaded
Scala Vienna Website: reloadedScala Vienna Website: reloaded
Scala Vienna Website: reloaded
Nikolay Kushin
 

What's hot (20)

Agile sites311training
Agile sites311trainingAgile sites311training
Agile sites311training
 
ReactJS Workflows
ReactJS WorkflowsReactJS Workflows
ReactJS Workflows
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Agile sites2
Agile sites2Agile sites2
Agile sites2
 
Perl hosting for beginners - Cluj.pm March 2013
Perl hosting for beginners - Cluj.pm March 2013Perl hosting for beginners - Cluj.pm March 2013
Perl hosting for beginners - Cluj.pm March 2013
 
Icinga Camp Amsterdam - Icinga Director
Icinga Camp Amsterdam - Icinga DirectorIcinga Camp Amsterdam - Icinga Director
Icinga Camp Amsterdam - Icinga Director
 
Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Agile sites @ telmore
Agile sites @ telmore Agile sites @ telmore
Agile sites @ telmore
 
OSGi Community Event 2010 - Eclipse Virgo Update
OSGi Community Event 2010 - Eclipse Virgo UpdateOSGi Community Event 2010 - Eclipse Virgo Update
OSGi Community Event 2010 - Eclipse Virgo Update
 
On the Importance of Infrastructure as Code
On the Importance of Infrastructure as CodeOn the Importance of Infrastructure as Code
On the Importance of Infrastructure as Code
 
Scala Vienna Website: reloaded
Scala Vienna Website: reloadedScala Vienna Website: reloaded
Scala Vienna Website: reloaded
 
CloudMonkey
CloudMonkeyCloudMonkey
CloudMonkey
 
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
 
Mini-Training: Redis
Mini-Training: RedisMini-Training: Redis
Mini-Training: Redis
 
Net coreandsimplcommerce
Net coreandsimplcommerceNet coreandsimplcommerce
Net coreandsimplcommerce
 
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
 
Cassandra Development Nirvana
Cassandra Development Nirvana Cassandra Development Nirvana
Cassandra Development Nirvana
 
Rails on HBase
Rails on HBaseRails on HBase
Rails on HBase
 
RoR app screencast
RoR app screencastRoR app screencast
RoR app screencast
 

Viewers also liked

Ù tai, nghe kém là dấu hiệu bệnh lý mạch máu não
Ù tai, nghe kém là dấu hiệu bệnh lý mạch máu nãoÙ tai, nghe kém là dấu hiệu bệnh lý mạch máu não
Ù tai, nghe kém là dấu hiệu bệnh lý mạch máu não
regena846
 
Quote 120923 NYTimes - Attack in Libya Was Major Blow to C.I.A. Efforts
Quote 120923 NYTimes - Attack in Libya Was Major Blow to C.I.A. EffortsQuote 120923 NYTimes - Attack in Libya Was Major Blow to C.I.A. Efforts
Quote 120923 NYTimes - Attack in Libya Was Major Blow to C.I.A. Efforts
Wolfgang Pusztai
 
ברושור למעסיק 2
ברושור למעסיק 2ברושור למעסיק 2
ברושור למעסיק 2
mtasuka
 
Nevin Shaji Philip
Nevin Shaji PhilipNevin Shaji Philip
Nevin Shaji Philip
Nevin Philip
 
Informativo nº 16 4º basico b- 13 de junio-1
Informativo nº 16  4º basico b- 13 de junio-1Informativo nº 16  4º basico b- 13 de junio-1
Informativo nº 16 4º basico b- 13 de junio-1
Colegio Camilo Henríquez
 

Viewers also liked (15)

Ù tai, nghe kém là dấu hiệu bệnh lý mạch máu não
Ù tai, nghe kém là dấu hiệu bệnh lý mạch máu nãoÙ tai, nghe kém là dấu hiệu bệnh lý mạch máu não
Ù tai, nghe kém là dấu hiệu bệnh lý mạch máu não
 
1st Celebration Night 2006
1st Celebration Night 20061st Celebration Night 2006
1st Celebration Night 2006
 
Quote 120923 NYTimes - Attack in Libya Was Major Blow to C.I.A. Efforts
Quote 120923 NYTimes - Attack in Libya Was Major Blow to C.I.A. EffortsQuote 120923 NYTimes - Attack in Libya Was Major Blow to C.I.A. Efforts
Quote 120923 NYTimes - Attack in Libya Was Major Blow to C.I.A. Efforts
 
ברושור למעסיק 2
ברושור למעסיק 2ברושור למעסיק 2
ברושור למעסיק 2
 
Prezentazzjoni 8.5
Prezentazzjoni 8.5Prezentazzjoni 8.5
Prezentazzjoni 8.5
 
Nevin Shaji Philip
Nevin Shaji PhilipNevin Shaji Philip
Nevin Shaji Philip
 
Cara membuat blog
Cara membuat blogCara membuat blog
Cara membuat blog
 
Métodos anticonceptivos
Métodos anticonceptivosMétodos anticonceptivos
Métodos anticonceptivos
 
Muestra de Taller de Teatro
Muestra de Taller de TeatroMuestra de Taller de Teatro
Muestra de Taller de Teatro
 
Profile Based Business Plan Raja Naren
Profile Based Business Plan Raja NarenProfile Based Business Plan Raja Naren
Profile Based Business Plan Raja Naren
 
Antonov225
Antonov225Antonov225
Antonov225
 
5º basico b 02 de octubre
5º basico b  02 de octubre5º basico b  02 de octubre
5º basico b 02 de octubre
 
Informativo nº 16 4º basico b- 13 de junio-1
Informativo nº 16  4º basico b- 13 de junio-1Informativo nº 16  4º basico b- 13 de junio-1
Informativo nº 16 4º basico b- 13 de junio-1
 
Support pratic 2011-2801
Support pratic 2011-2801Support pratic 2011-2801
Support pratic 2011-2801
 
Procesador De Textos
Procesador De TextosProcesador De Textos
Procesador De Textos
 

Similar to Vagrant&ansible

Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013
Hendrik Ebbers
 
Rackspace Private Cloud presentation for ChefConf 2013
Rackspace Private Cloud presentation for ChefConf 2013Rackspace Private Cloud presentation for ChefConf 2013
Rackspace Private Cloud presentation for ChefConf 2013
Joe Breu
 
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)
開放原始碼 Ch1.2   intro - oss - apahce foundry (ver 2.0)開放原始碼 Ch1.2   intro - oss - apahce foundry (ver 2.0)
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)
My own sweet home!
 

Similar to Vagrant&ansible (20)

Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013
 
The future of the php development environment
The future of the php development environmentThe future of the php development environment
The future of the php development environment
 
Developing web apps
Developing web appsDeveloping web apps
Developing web apps
 
OpenStack and Windows
OpenStack and WindowsOpenStack and Windows
OpenStack and Windows
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using Docker
 
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezDevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
 
Vagrant Plugin development
Vagrant Plugin developmentVagrant Plugin development
Vagrant Plugin development
 
Vincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostusta
Vincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostustaVincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostusta
Vincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostusta
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
 
Virtualizing Development
Virtualizing DevelopmentVirtualizing Development
Virtualizing Development
 
Rackspace Private Cloud presentation for ChefConf 2013
Rackspace Private Cloud presentation for ChefConf 2013Rackspace Private Cloud presentation for ChefConf 2013
Rackspace Private Cloud presentation for ChefConf 2013
 
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and WindowsOpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
 
Containerdays Intro to Habitat
Containerdays Intro to HabitatContainerdays Intro to Habitat
Containerdays Intro to Habitat
 
Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016
 
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)
開放原始碼 Ch1.2   intro - oss - apahce foundry (ver 2.0)開放原始碼 Ch1.2   intro - oss - apahce foundry (ver 2.0)
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)
 
Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Vagrant&ansible

  • 2. About Me • Automation enthusiast • Worked in corporate environments • Now co-founder of a small startup company
  • 3. Agenda • Vagrant intro • Simple LAMP provisioning setup • Demo of provisioning on virtual box • Switching vagrant provider to openstack
  • 4. What is VAGRANT • https://www.vagrantup.com/ • Manage development environments – up/destroy machines • Works with different virtualization providers • “Easy” ruby syntax • Supports different provisioners
  • 5. Our Simple LAMP • Linux – Debian box image • Apache with PHP and memcached • MySQL / MariaDB • Deploy application and load database from a git repo
  • 6. Ansible highlights • apt • Git • Templates - name: ensure apache is installed apt: name=apache2 state=present - git: repo=git@github.com/wiki.git dest=/var/www/site/ accept_hostkey=yes - copy: src=templates/site.conf dest=/etc/apache2/sites-enabled/site.conf
  • 7. Ansible highlights • MySql DB – import • Notify - name: create wiki app db mysql_db: name=wikidb state=import target=/var/www/site/wikidb.sql handlers: - name: restart apache action: service name=apache2 state=restarted
  • 8. Vagrant Ansible provisioner • Pass variables (facts) to the playbook • Vagrant specific – like IP config.vm.provision 'ansible' do |ansible| ansible.playbook = 'ansible/playbook.yml' ansible.verbose = 'vvv' ansible.extra_vars = { ans_vm_priv_ip: vm_priv_ip } end
  • 9. Switch the provider to OpenStack vagrant plugin install vagrant-openstack-provider 2. VM is booted 1. Create VM (up) 3. Provision VM over ssh
  • 10. OpenStack provider Vagrantfile config.vm.provider :openstack do |os| os.openstack_auth_url =ENV['OS_AUTH_URL'] os.tenant_name=ENV['OS_TENANT_NAME'] os.username = ENV['OS_USERNAME'] os.password = ENV['OS_PASSWORD'] os.floating_ip_pool = ENV['OS_FLOATING_IP_POOL'] os.flavor = ENV['OS_FLAVOR'] os.image = ENV['OS_IMAGE'] end