Skip to content

Instantly share code, notes, and snippets.

@Herzult
Created February 15, 2013 15:53
Show Gist options
  • Save Herzult/4961257 to your computer and use it in GitHub Desktop.
Save Herzult/4961257 to your computer and use it in GitHub Desktop.
puppet module install example42/apache --modulepath=app/Resources/puppet/modules
puppet module install example42/mysql --modulepath=app/Resources/puppet/modules
puppet module install example42/php --modulepath=app/Resources/puppet/modules
vagrant up
# app/Resources/puppet/manifests/site.pp
Exec { path => ['/bin', '/sbin' , '/usr/bin', '/usr/sbin'] }
class { 'apache':
process_user => 'vagrant'
}
apache::vhost { 'foobar.dev':
docroot => '/vagrant/web'
}
file { '/etc/apache2/sites-enabled/000-default':
ensure => absent,
require => Package['apache'],
notify => Service['apache']
}
class { 'mysql': }
mysql::grant { 'foobar':
mysql_privileges => 'ALL',
mysql_db => 'foobar',
mysql_user => 'foobar',
mysql_password => 'foobarpass',
mysql_host => '%'
}
class { 'php': }
php::module { 'mysql': }
php::module { 'intl': }
php::module { 'apc':
module_prefix => 'php-'
}
$php_conf_generic = [
'set PHP/short_open_tag Off',
'set Date/date.timezone Europe/Paris'
]
augeas { 'cli-php-conf':
context => '/files/etc/php5/cli/php.ini',
changes => $php_conf_generic,
require => Package['php'],
notify => Service['apache']
}
augeas { 'apache-php-conf':
context => '/files/etc/php5/apache2/php.ini',
changes => $php_conf_generic,
require => Package['php'],
notify => Service['apache']
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.share_folder "v-root", "/vagrant", ".", :nfs => true
config.vm.network :hostonly, "192.168.50.4"
config.vm.forward_port 80, 8080
config.vm.provision :shell, :inline => "sudo apt-get update && sudo apt-get install puppet -y"
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "app/Resources/puppet/manifests"
puppet.module_path = "app/Resources/puppet/modules"
puppet.manifest_file = "site.pp"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment