SlideShare a Scribd company logo
1 of 19
Download to read offline
Provisioning your
environment
Leveraging Vagrant, Ansible, and AWS
Provisioning your environment
Rich Gwozdz, Spatial Development International
Provisioning includes:
• Installing software (Apache, PGRestAPI, Postgres)
• Adding data (restore databases)
• Configuration (configure Apache)
• Anything needed to run your server application
Often executed via SSH session and bash scripting:
# Install Postgres
$ apt-get postgresql-9.4-postgis-2.1
…
…
# Trust Connections
$ sudo nano /etc/postgres/9.4/main/pg_hba.conf
Provisioning your environment
Rich Gwozdz, Spatial Development International
You can provision with bash alone; requires careful scripting
• variables
• conditionals
• http requests
• file transfers
Enter Provisioning Frameworks:
• ease provisioning script development
• provided tested, maintained modules
• provide a sharing infrastructure
Provisioning your environment
Rich Gwozdz, Spatial Development International
Ansible: simple & straightforward
• simple and straightforward
• YAML
• SSH
Provisioning your environment
Rich Gwozdz, Spatial Development International
Ansible playbook
Provisioning your environment
Rich Gwozdz, Spatial Development International
hosts: A group of target
servers listed in:
/etc/ansible/hosts
[ec2s]
123.4.5.6
Ansible playbook
Provisioning your environment
Rich Gwozdz, Spatial Development International
var_files: files containing
variables/settings to be used
in all task
Ansible playbook
Provisioning your environment
Rich Gwozdz, Spatial Development International
role: a role is a set of
tasks that address a discrete
unit of work. Easily shared
across playbooks
Ansible playbook
Provisioning your environment
Rich Gwozdz, Spatial Development International
handler: helper functions
Ansible playbook
Provisioning your environment
Rich Gwozdz, Spatial Development International
tasks: individual plays not
grouped into roles
Ansible playbook
Provisioning your environment
Rich Gwozdz, Spatial Development International
{{ my_var }} : example of
variable usage
Ansible playbook
Provisioning your environment
Rich Gwozdz, Spatial Development International
# Run playbook
$ ansible-playbook -u ubuntu playbook.yml
Provisioning your environment
Rich Gwozdz, Spatial Development International
Ansible Mangement Node
• Separate server: configured for SSH with target hosts
• Local machine: but requires config changes - could get out of sync
• Vagrant VM: distribute it via Git!
Provisioning your environment
Rich Gwozdz, Spatial Development International
Vagrant VM as Ansible Mangement Node
Vagrant provides “lightweight,
reproducible, and portable development
environments” (i.e., server VMs) with
VirtualBox and some other goodies
Provisioning your environment
Rich Gwozdz, Spatial Development International
Vagrant VM as Ansible Mangement Node
Provisioning your environment
Rich Gwozdz, Spatial Development International
Vagrant VM as Ansible Mangement Node
Why?
• Vagrant VMs are distributable by Git repos
• Everyone’s Management node would be identical
• Can double as a local deployment of your environment
Cloned Git repo
Provisioning your environment
Rich Gwozdz, Spatial Development International
Vagrant VM as Ansible Mangement Node AND Target host
Local dev environment = deployment environment
Cloned Git repo
Provisioning your environment
Rich Gwozdz, Spatial Development International
Additional Ansible goodies
Great AWS support
• Create, delete EC2
• Create, delete Security Groups
• Set Elastic IPs
• Set EC2s as provisioning target hosts via tags rather than hard-code
IPs
Ansible Galaxy
• Hub for find, reusing, sharing Ansible roles (kind of like npm)
Provisioning your environment
Rich Gwozdz, Spatial Development International
Questions?

More Related Content

What's hot

SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 

What's hot (20)

Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software Development
 
Continuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as CodeContinuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as Code
 
Ansible - A 'crowd' introduction
Ansible - A 'crowd' introductionAnsible - A 'crowd' introduction
Ansible - A 'crowd' introduction
 
How Ansible Makes Automation Easy
How Ansible Makes Automation EasyHow Ansible Makes Automation Easy
How Ansible Makes Automation Easy
 
Ansible + WordPress
Ansible + WordPressAnsible + WordPress
Ansible + WordPress
 
Vagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-inVagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-in
 
Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021
 
Vagrant + Docker
Vagrant + DockerVagrant + Docker
Vagrant + Docker
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and OscarWebinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
 
Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
 
Ansible in CI
Ansible in CIAnsible in CI
Ansible in CI
 
Vagrant crash course
Vagrant crash courseVagrant crash course
Vagrant crash course
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
 
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
 
Improved development workflows using vagrant
Improved development workflows using vagrantImproved development workflows using vagrant
Improved development workflows using vagrant
 
Ansible
AnsibleAnsible
Ansible
 

Viewers also liked

Viewers also liked (12)

Hands on para (web)Developers Docker vs Vagrant
Hands on para (web)Developers Docker vs VagrantHands on para (web)Developers Docker vs Vagrant
Hands on para (web)Developers Docker vs Vagrant
 
Vagrant - Concept
Vagrant - ConceptVagrant - Concept
Vagrant - Concept
 
Open source integrated infra structure using ansible configuration management
Open source integrated infra structure using ansible configuration managementOpen source integrated infra structure using ansible configuration management
Open source integrated infra structure using ansible configuration management
 
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
 
Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1
 
Cyansible
CyansibleCyansible
Cyansible
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
 
DevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesDevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and Processes
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyond
 
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
AnsibleBuilding a Docker-ized Microservice  In Node, Using Ansible - AnsibleF...AnsibleBuilding a Docker-ized Microservice  In Node, Using Ansible - AnsibleF...
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 

Similar to Provisioning your Environment with Vagrant and Ansible

2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and Docker
Fabio Fumarola
 

Similar to Provisioning your Environment with Vagrant and Ansible (20)

Deploying to Ubuntu on Linode
Deploying to Ubuntu on LinodeDeploying to Ubuntu on Linode
Deploying to Ubuntu on Linode
 
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
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
OpenStack and Windows
OpenStack and WindowsOpenStack and Windows
OpenStack and Windows
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
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...
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
 
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
 
NYC Identity Summit Tech Day: ForgeRock DevOps/Cloud Strategy
NYC Identity Summit Tech Day: ForgeRock DevOps/Cloud StrategyNYC Identity Summit Tech Day: ForgeRock DevOps/Cloud Strategy
NYC Identity Summit Tech Day: ForgeRock DevOps/Cloud Strategy
 
Kubernetes automation in production
Kubernetes automation in productionKubernetes automation in production
Kubernetes automation in production
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and Docker
 
Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
 
Develop with linux containers and docker
Develop with linux containers and dockerDevelop with linux containers and docker
Develop with linux containers and docker
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
Ansible E2E Testing
Ansible E2E TestingAnsible E2E Testing
Ansible E2E Testing
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and Packer
 
Challenges for Deploying a High-Performance Computing Application to the Cloud
Challenges for Deploying a High-Performance Computing Application to the CloudChallenges for Deploying a High-Performance Computing Application to the Cloud
Challenges for Deploying a High-Performance Computing Application to the Cloud
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Developing web apps
Developing web appsDeveloping web apps
Developing web apps
 
Best Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBest Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker Containers
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Recently uploaded (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 

Provisioning your Environment with Vagrant and Ansible

  • 2. Provisioning your environment Rich Gwozdz, Spatial Development International Provisioning includes: • Installing software (Apache, PGRestAPI, Postgres) • Adding data (restore databases) • Configuration (configure Apache) • Anything needed to run your server application Often executed via SSH session and bash scripting: # Install Postgres $ apt-get postgresql-9.4-postgis-2.1 … … # Trust Connections $ sudo nano /etc/postgres/9.4/main/pg_hba.conf
  • 3. Provisioning your environment Rich Gwozdz, Spatial Development International You can provision with bash alone; requires careful scripting • variables • conditionals • http requests • file transfers Enter Provisioning Frameworks: • ease provisioning script development • provided tested, maintained modules • provide a sharing infrastructure
  • 4. Provisioning your environment Rich Gwozdz, Spatial Development International Ansible: simple & straightforward • simple and straightforward • YAML • SSH
  • 5. Provisioning your environment Rich Gwozdz, Spatial Development International Ansible playbook
  • 6. Provisioning your environment Rich Gwozdz, Spatial Development International hosts: A group of target servers listed in: /etc/ansible/hosts [ec2s] 123.4.5.6 Ansible playbook
  • 7. Provisioning your environment Rich Gwozdz, Spatial Development International var_files: files containing variables/settings to be used in all task Ansible playbook
  • 8. Provisioning your environment Rich Gwozdz, Spatial Development International role: a role is a set of tasks that address a discrete unit of work. Easily shared across playbooks Ansible playbook
  • 9. Provisioning your environment Rich Gwozdz, Spatial Development International handler: helper functions Ansible playbook
  • 10. Provisioning your environment Rich Gwozdz, Spatial Development International tasks: individual plays not grouped into roles Ansible playbook
  • 11. Provisioning your environment Rich Gwozdz, Spatial Development International {{ my_var }} : example of variable usage Ansible playbook
  • 12. Provisioning your environment Rich Gwozdz, Spatial Development International # Run playbook $ ansible-playbook -u ubuntu playbook.yml
  • 13. Provisioning your environment Rich Gwozdz, Spatial Development International Ansible Mangement Node • Separate server: configured for SSH with target hosts • Local machine: but requires config changes - could get out of sync • Vagrant VM: distribute it via Git!
  • 14. Provisioning your environment Rich Gwozdz, Spatial Development International Vagrant VM as Ansible Mangement Node Vagrant provides “lightweight, reproducible, and portable development environments” (i.e., server VMs) with VirtualBox and some other goodies
  • 15. Provisioning your environment Rich Gwozdz, Spatial Development International Vagrant VM as Ansible Mangement Node
  • 16. Provisioning your environment Rich Gwozdz, Spatial Development International Vagrant VM as Ansible Mangement Node Why? • Vagrant VMs are distributable by Git repos • Everyone’s Management node would be identical • Can double as a local deployment of your environment Cloned Git repo
  • 17. Provisioning your environment Rich Gwozdz, Spatial Development International Vagrant VM as Ansible Mangement Node AND Target host Local dev environment = deployment environment Cloned Git repo
  • 18. Provisioning your environment Rich Gwozdz, Spatial Development International Additional Ansible goodies Great AWS support • Create, delete EC2 • Create, delete Security Groups • Set Elastic IPs • Set EC2s as provisioning target hosts via tags rather than hard-code IPs Ansible Galaxy • Hub for find, reusing, sharing Ansible roles (kind of like npm)
  • 19. Provisioning your environment Rich Gwozdz, Spatial Development International Questions?