SlideShare a Scribd company logo
1 of 15
Clean development
environment for Drupal
with Vagrant & Puppet
Drupal Meetup Cebu, Philippines. 26/06/13.
Luc Bezier | luc@webizat.com
Who?
- Luc Bézier
- Freelance web developer from France,
then England ... and since few weeks Cebu.
- I’m available for work!
Contact me: luc@webizat.com
- Find me on Twitter @Luukyb
(warning, I’m tweeting about cheese)
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
What?
Virtual machine
Vagrant
Puppet
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
}Clean development
environment
Why?
- (M/W/L)amp stack to install on top of your
computer’s OS
- Creates a high dependency between your
system and you development environment
-You development environment will never be
like production.
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
Puppet
- Configuration management tool
- Apply a manifest (.pp)
- Contrib modules or do a custom module ...
sounds familiar
- Puppet command available in yourVM
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
Vagrant
- On top ofVirtual Box
- Configuration using a Vagrantfile
- Uses a shared folder between your
computer and yourVM
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
Vagrant
- vagrant up
- vagrant halt
- vagrant ssh
… and sometimes vagrant destroy
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
The 3 main commands you will use:
How to?
- InstallVirtualBox &Vagrant
- Add a box :
vagrant box add base [box url]
- Setup your /etc/hosts (or equivalent)
- Place your drupal files into the vagrant
folder
- And ... vagrant up !
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
Vagrantfile
- Tell vagrant about your box
config.vm.box
-Your network configuration & share folder
config.vm.network
config.vm.share_folder
- I want to use puppet!
config.vm.provision :puppet
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
Puppet apache
- Using the contrib module from puppetlabs
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
class { 'apache':
default_mods => true,
mpm_module => 'prefork',
}
include apache::mod::php
apache::vhost { 'vagrant.local':
port => '80',
docroot => '/var/www/drupal-project',
}
- Module: github.com/puppetlabs/puppetlabs-apache
Puppet symlink
- Symlink in your “www” directory to target
your shared folder, where your drupal is.
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
file { '/var/www/drupal-project':
ensure => 'link',
target => '/vagrant/drupal-project',
}
Puppet mysql
- Using the contrib module from puppetlabs
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
class { 'mysql::server':
config_hash => { 'root_password' => 'root' }
}
mysql::db { 'drupal’:
user => 'drupal',
password => 'drupal',
host => 'localhost', grant => ['all'],
}
- Change the passwords ;)
- Module: github.com/puppetlabs/puppetlabs-mysql
Puppet php
- Using a very simple custom module
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
package { "php5”:
ensure => present,
}
package { "drush”:
ensure => present,
}
}
Repeat this code for
every php extension you need,
php5-mysql, php5-gd ...
- Drush is included in the php packages for lucid.
Full version of the code:
github.com/Luukyb/drupal-puppet
Do try this at home
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
Give a try to my simple puppet-drupal project:
github.com/Luukyb/drupal-puppet
Try the drupal project for vagrant:
drupal.org/project/vagrant
Project Oscar (by
@manarth):github.com/manarth/oscar
Thanks!
Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
Any questions ?
Special thanks to Promet Source (@prometsource) & Jonathan Himbing
(@nathanjo) for organizing the Drupal meetup Cebu, Philippines.
Drupal Pilipinas (@DrupalPilipinas)

More Related Content

Viewers also liked (15)

Capitulo 07
Capitulo 07Capitulo 07
Capitulo 07
 
Capitulo 17
Capitulo 17Capitulo 17
Capitulo 17
 
La dictadura de stalin
La dictadura de stalinLa dictadura de stalin
La dictadura de stalin
 
INVESTIGACIÓN POLITICA
INVESTIGACIÓN POLITICAINVESTIGACIÓN POLITICA
INVESTIGACIÓN POLITICA
 
Kabakulak
KabakulakKabakulak
Kabakulak
 
Interdisciplinary collaboration in the Veterans health care sector - Final
Interdisciplinary collaboration in the Veterans health care sector - FinalInterdisciplinary collaboration in the Veterans health care sector - Final
Interdisciplinary collaboration in the Veterans health care sector - Final
 
Peradaban suku maya
Peradaban suku  mayaPeradaban suku  maya
Peradaban suku maya
 
General embryology
General embryologyGeneral embryology
General embryology
 
In line or out of control?
In line or out of control?In line or out of control?
In line or out of control?
 
Solidos platonicos (1)
Solidos platonicos (1)Solidos platonicos (1)
Solidos platonicos (1)
 
Revolucion rusa
Revolucion rusa Revolucion rusa
Revolucion rusa
 
Sólidos platónicos
Sólidos platónicosSólidos platónicos
Sólidos platónicos
 
First Aid
First AidFirst Aid
First Aid
 
Impresionismo y post impresionismo
Impresionismo y post impresionismo Impresionismo y post impresionismo
Impresionismo y post impresionismo
 
Aulas de filosofia platão
Aulas de filosofia platãoAulas de filosofia platão
Aulas de filosofia platão
 

More from Luc Bézier

More from Luc Bézier (10)

Quick guide to Freedom and travels for developers
Quick guide to Freedom and travels for developersQuick guide to Freedom and travels for developers
Quick guide to Freedom and travels for developers
 
Guide to freedom and travels for developers
Guide to freedom and travels for developersGuide to freedom and travels for developers
Guide to freedom and travels for developers
 
The Future of Offices
The Future of OfficesThe Future of Offices
The Future of Offices
 
Drupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamDrupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your team
 
Introduction to Composer for Drupal
Introduction to Composer for DrupalIntroduction to Composer for Drupal
Introduction to Composer for Drupal
 
Drupal for beginners - Global Training Days - Cebu 2016
Drupal for beginners - Global Training Days - Cebu 2016Drupal for beginners - Global Training Days - Cebu 2016
Drupal for beginners - Global Training Days - Cebu 2016
 
Made with drupal 8
Made with drupal 8Made with drupal 8
Made with drupal 8
 
Open Source Software, community matters
Open Source Software, community mattersOpen Source Software, community matters
Open Source Software, community matters
 
Data migration to Drupal using the migrate module
Data migration to Drupal using the migrate moduleData migration to Drupal using the migrate module
Data migration to Drupal using the migrate module
 
Drupal ladder Cebu : Learn to contribute | November 2013
Drupal ladder Cebu : Learn to contribute | November 2013Drupal ladder Cebu : Learn to contribute | November 2013
Drupal ladder Cebu : Learn to contribute | November 2013
 

Recently uploaded

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
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 

Recently uploaded (20)

ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
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
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
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)
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 

Clean development environment for Drupal

  • 1. Clean development environment for Drupal with Vagrant & Puppet Drupal Meetup Cebu, Philippines. 26/06/13. Luc Bezier | luc@webizat.com
  • 2. Who? - Luc Bézier - Freelance web developer from France, then England ... and since few weeks Cebu. - I’m available for work! Contact me: luc@webizat.com - Find me on Twitter @Luukyb (warning, I’m tweeting about cheese) Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
  • 3. What? Virtual machine Vagrant Puppet Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb }Clean development environment
  • 4. Why? - (M/W/L)amp stack to install on top of your computer’s OS - Creates a high dependency between your system and you development environment -You development environment will never be like production. Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
  • 5. Puppet - Configuration management tool - Apply a manifest (.pp) - Contrib modules or do a custom module ... sounds familiar - Puppet command available in yourVM Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
  • 6. Vagrant - On top ofVirtual Box - Configuration using a Vagrantfile - Uses a shared folder between your computer and yourVM Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
  • 7. Vagrant - vagrant up - vagrant halt - vagrant ssh … and sometimes vagrant destroy Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb The 3 main commands you will use:
  • 8. How to? - InstallVirtualBox &Vagrant - Add a box : vagrant box add base [box url] - Setup your /etc/hosts (or equivalent) - Place your drupal files into the vagrant folder - And ... vagrant up ! Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
  • 9. Vagrantfile - Tell vagrant about your box config.vm.box -Your network configuration & share folder config.vm.network config.vm.share_folder - I want to use puppet! config.vm.provision :puppet Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb
  • 10. Puppet apache - Using the contrib module from puppetlabs Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb class { 'apache': default_mods => true, mpm_module => 'prefork', } include apache::mod::php apache::vhost { 'vagrant.local': port => '80', docroot => '/var/www/drupal-project', } - Module: github.com/puppetlabs/puppetlabs-apache
  • 11. Puppet symlink - Symlink in your “www” directory to target your shared folder, where your drupal is. Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb file { '/var/www/drupal-project': ensure => 'link', target => '/vagrant/drupal-project', }
  • 12. Puppet mysql - Using the contrib module from puppetlabs Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb class { 'mysql::server': config_hash => { 'root_password' => 'root' } } mysql::db { 'drupal’: user => 'drupal', password => 'drupal', host => 'localhost', grant => ['all'], } - Change the passwords ;) - Module: github.com/puppetlabs/puppetlabs-mysql
  • 13. Puppet php - Using a very simple custom module Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb package { "php5”: ensure => present, } package { "drush”: ensure => present, } } Repeat this code for every php extension you need, php5-mysql, php5-gd ... - Drush is included in the php packages for lucid. Full version of the code: github.com/Luukyb/drupal-puppet
  • 14. Do try this at home Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb Give a try to my simple puppet-drupal project: github.com/Luukyb/drupal-puppet Try the drupal project for vagrant: drupal.org/project/vagrant Project Oscar (by @manarth):github.com/manarth/oscar
  • 15. Thanks! Drupal, Vagrant & Puppet luc@webizat.com | @Luukyb Any questions ? Special thanks to Promet Source (@prometsource) & Jonathan Himbing (@nathanjo) for organizing the Drupal meetup Cebu, Philippines. Drupal Pilipinas (@DrupalPilipinas)