Coder Social home page Coder Social logo

vagrant-puppet's Introduction

Vagrant Lamp Stack

This is the Vagrant - Puppet configuration I use for developing my projects. Credit goes to pyrocms's similar setup https://github.com/pyrocms/devops-vagrant

How to use

Download this repository and use it as a git submoudle in your projects. Change the Vagrantfile settings to better suit your needs all the rest should work fine out of the box. Here's an example Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|

  # choose which box to use
  config.vm.box = "precise64"
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
  
  # set the timezone to something that makes sense to you
  config.vm.provision :shell, :inline => "echo \"Europe/Rome\" | sudo tee /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata"
  
  # use a meaningful hostname
  config.vm.host_name = "lamp"
  
  #set the ip address of the machine (choose a different one if it's aleady taken by another vm)
  config.vm.network :hostonly, "198.18.0.11"
  
  # enable nfs on the root folder
  config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true)
  
  # update the machine
  config.vm.provision :shell, :inline => "apt-get update --fix-missing"

  # provision the stack
  config.vm.provision :puppet do |puppet|
  
    # change fqdn to give to change the vm virtual host
    puppet.facter = { 
      "fqdn" => "vagrant-lamp-stack", 
      "hostname" => "www", 
      "docroot" => "/vagrant/public",
      "db_name" => "lamp",
      "db_user" => "lamp",
      "db_pass" => "lamp",
      "db_host" => "localhost",
    }
    
    # set the puppet manifests directory (relative to the project's root)
    puppet.manifests_path = "vagrant-puppet/manifests"
    
    # choose the manifest
    puppet.manifest_file  = "ubuntu-apache2-mysql-php5.pp"
    
    # instruct puppet where the modules are
    puppet.module_path = "vagrant-puppet/modules"
    
  end
  
  # ready to go!
  
end

Connecting to the DB

Since this was a pain for me at first, to connect to the DB from outside the VM you have to tunnel inside the machine, then connect to the database.

vagrant-puppet's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.