Skip to content

Instantly share code, notes, and snippets.

@aranw
Created January 23, 2013 00:06
Show Gist options
  • Save aranw/4600205 to your computer and use it in GitHub Desktop.
Save aranw/4600205 to your computer and use it in GitHub Desktop.
Vagrant Puppet Config
# Basic Puppet manifest
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
class system-update {
file { "/etc/apt/sources.list.d/dotdeb.list":
owner => root,
group => root,
mode => 664,
source => "/vagrant/conf/apt/dotdeb.list",
}
exec { 'dotdeb-apt-key':
cwd => '/tmp',
command => "wget http://www.dotdeb.org/dotdeb.gpg -O dotdeb.gpg &&
cat dotdeb.gpg | apt-key add -",
unless => 'apt-key list | grep dotdeb',
require => File['/etc/apt/sources.list.d/dotdeb.list'],
notify => Exec['apt_update'],
}
$sysPackages = [ "build-essential" ]
exec { 'apt-update':
command => 'apt-get update --fix-missing',
}
package { $sysPackages:
ensure => "installed",
require => Exec['apt-update'],
}
}
class nginx-setup {
include nginx
file { "/etc/nginx/sites-available/php-fpm":
owner => root,
group => root,
mode => 664,
source => "/vagrant/conf/nginx/default",
require => Package["nginx"],
notify => Service["nginx"],
}
file { "/etc/nginx/sites-enabled/default":
owner => root,
ensure => link,
target => "/etc/nginx/sites-available/php-fpm",
require => Package["nginx"],
notify => Service["nginx"],
}
}
class development {
$devPackages = [ "curl", "git", "nodejs", "npm", "rubygems", "libaugeas-ruby" ]
package { $devPackages:
ensure => "installed",
require => Exec['apt-update'],
}
}
class install_composer {
exec { 'install composer':
command => 'curl -s http://getcomposer.org/installer | php -- --install-dir=/vagrant/www/',
}
}
class devbox_php_fpm {
php::module { [
'curl', 'gd', 'mcrypt', 'memcached', 'mysql',
'tidy', 'php-xhprof', 'imap',
]:
notify => Class['php::fpm::service'],
}
php::module { [ 'memcache', 'php-apc', ]:
notify => Class['php::fpm::service'],
source => '/etc/php5/conf.d/',
}
php::module { [ 'xdebug', ]:
notify => Class['php::fpm::service'],
source => '/etc/php5/conf.d/',
}
php::module { [ 'suhosin', ]:
notify => Class['php::fpm::service'],
source => '/vagrant/conf/php/',
}
exec { 'pecl-mongo-install':
command => 'pecl install mongo',
unless => "pecl info mongo",
notify => Class['php::fpm::service'],
require => Package['php-pear'],
}
exec { 'pecl-xhprof-install':
command => 'pecl install xhprof-0.9.2',
unless => "pecl info xhprof",
notify => Class['php::fpm::service'],
require => Package['php-pear'],
}
php::conf { [ 'mysqli', 'pdo', 'pdo_mysql', ]:
require => Package['php-mysql'],
notify => Class['php::fpm::service'],
}
file { "/etc/php5/conf.d/custom.ini":
owner => root,
group => root,
mode => 664,
source => "/vagrant/conf/php/custom.ini",
notify => Class['php::fpm::service'],
}
file { "/etc/php5/fpm/pool.d/www.conf":
owner => root,
group => root,
mode => 664,
source => "/vagrant/conf/php/php-fpm/www.conf",
notify => Class['php::fpm::service'],
}
}
include system-update
include php::fpm
include devbox_php_fpm
include phpqatools
include development
include install_composer
include nginx-setup
include puppi
include mysql
package { 'mysql':
ensure => "installed",
require => Exec['apt-update'],
}
# MySQL Server
class { 'mysql::server':
config_hash => {
'root_password' => 'l1k3ab0ss',
'bind_address' => '33.33.33.10'
}
}
mysql::db { 'bills':
user => 'bills',
password => 'bills',
host => 'localhost',
grant => ['all'],
charset => 'utf8',
}
class {'mongodb':
enable_10gen => true,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment