I am using my first Foray to use Vagrant + Puppet Provisioning scripts to improve my development workflow.
I'm currently trying to set up the dev block for L4 development - and I'm using https://github.com/paolooo/vagrant-lamp and https://github.com/paolooo/puppet-laravel .
Following the instructions:
Clone LAMP field:
git clone git://github.com/paolooo/vagrant-lamp.git lamp
cd lamp
Add scripts for preparing to use Puppet:
git submodule add https:
Then update the submodules:
git submodule update
Great so far - light material ...
So, now itβs ready to run vagrant up- which seems to provide excellent performance for the virtual machine and loads it.
, , init.pp script. 404, apt-get <<package>>.
, , mysql-client ( ), .
OSX Windows.
- .
Script:
Exec { path => ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin', '/usr/local/sbin', '/opt/local/bin'] }
exec { 'apt-get update':
command => '/usr/bin/apt-get update --fix-missing',
require => Exec['add php54 apt-repo']
}
if $db_name == '' { $db_name = 'development' }
if $db_location == '' { $db_location = '/vagrant/db/development.sqlite' }
if $username == '' { $username = 'root' }
if $password == '' { $password = '123' }
if $host == '' { $host = 'localhost' }
include php54
class { 'php': version => latest, }
include apache
class {'apache::mod::php': }
package { ['vim','curl','unzip','git','php5-mcrypt','php5-memcached']:
ensure => installed,
require => Exec['apt-get update'],
}
package { ['php5-mysql','php5-sqlite']:
ensure => installed,
require => Exec['apt-get update'],
}
include pear
include composer
apache::vhost { $fqdn:
priority => '20',
port => '80',
docroot => $docroot,
logroot => $docroot,
configure_firewall => false,
}
a2mod { 'rewrite': ensure => present }
class { "ruby":
gems_version => "latest"
}
class { "nodejs": }
php::module { ['curl', 'gd']:
notify => [ Service['httpd'], ],
}
pear::package { "PEAR": }
pear::package { "PHPUnit":
version => "latest",
repository => "pear.phpunit.de",
require => Pear::Package["PEAR"],
}
pear::package { "Yaml":
version => "latest",
repository => "pear.symfony.com",
require => Pear::Package["PEAR"]
}
class { 'mysql::server':
config_hash => { 'root_password' => "${password}" }
}
class { 'mysql': }
mysql::db { "${db_name}":
user => "${username}",
password => "${password}",
host => "${host}",
grant => ['all'],
charset => 'utf8',
}
class { 'postgresql':
version => 'latest',
}
class { 'postgresql::server': }
postgresql::db { "${db_name}":
owner => "${username}",
password => "${password}",
}
class { 'sqlite': }
define sqlite::db(
$location = '',
$owner = 'root',
$group = 0,
$mode = '755',
$ensure = present,
$sqlite_cmd = 'sqlite3'
) {
file { $safe_location:
ensure => $ensure,
owner => $owner,
group => $group,
notify => Exec['create_development_db']
}
exec { 'create_development_db':
command => "${sqlite_cmd} $db_location",
path => '/usr/bin:/usr/local/bin',
refreshonly => true,
}
}
class { 'phpmyadmin': }
:
Vagrant::Config.run do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.network :hostonly, "192.168.33.10"
config.vm.forward_port 80, 8082
config.vm.share_folder "v-data", "/vagrant/db", "./db"
config.vm.share_folder "v-web", "/vagrant/www", "c:\\www"
config.vm.provision :puppet do |puppet|
puppet.facter = {
"fqdn" => "dev.lamp.mysql",
"hostname" => "www",
"docroot" => "/vagrant/www",
"host" => 'localhost',
"username" => 'root',
"password" => '123',
"db_name" => "development",
"db_location" => "/vagrant/db/development.sqlite"
}
puppet.manifests_path = "puppet/manifests"
puppet.module_path = ["puppet/modules", "extras/modules"]
puppet.manifest_file = "init.pp"
end
end