Skip to content

Instantly share code, notes, and snippets.

@squiter
Created July 5, 2012 21:12
Show Gist options
  • Save squiter/3056452 to your computer and use it in GitHub Desktop.
Save squiter/3056452 to your computer and use it in GitHub Desktop.
[Abstraindo] Vagrant de forma simples - Arquivos finais
# Puppet configurations
class base {
## Update apt-get ##
exec { 'apt-get update':
command => '/usr/bin/apt-get update'
}
## Tools ##
package { "curl":
ensure => present,
}
package { "imagemagick":
ensure => present,
}
package { "vim":
ensure => present,
}
package { "git-core":
ensure => present,
}
package { "subversion":
ensure => present,
}
}
class http {
file{
"/etc/apache2/sites-enabled/000-default":
mode => 755,
owner => root,
group => root,
source => "/vagrant/manifests/configurations/sites-enabled.conf",
notify => Service[apache2]
}
file{
"/etc/apache2/sites-enabled/custom-vhost.conf":
mode => 755,
owner => root,
group => root,
source => "/vagrant/manifests/configurations/custom-vhosts.conf",
notify => Service[apache2]
}
file{
"/etc/apache2/apache2.conf":
mode => 644,
owner => root,
group => root,
source => "/vagrant/manifests/configurations/httpd.conf",
notify => Service[apache2]
}
define apache::loadmodule () {
exec { "/usr/sbin/a2enmod $name" :
unless => "/bin/readlink -e /etc/apache2/mods-enabled/${name}.load",
notify => Service[apache2]
}
}
apache::loadmodule{"rewrite":}
package { "apache2":
ensure => present,
}
service { "apache2":
ensure => running,
require => Package["apache2"],
}
}
class php{
file{
"/etc/php5/apache2/php.ini":
mode => 644,
owner => root,
group => root,
source => "/vagrant/manifests/configurations/php.ini"
}
package { "php5":
ensure => present,
}
package { "php5-cli":
ensure => present,
}
package { "php5-xdebug":
ensure => present,
}
package { "php5-mysql":
ensure => present,
}
package { "php5-imagick":
ensure => present,
}
package { "php5-mcrypt":
ensure => present,
}
package { "php-pear":
ensure => present,
}
package { "php5-dev":
ensure => present,
}
package { "php5-curl":
ensure => present,
}
package { "php5-sqlite":
ensure => present,
}
package { "libapache2-mod-php5":
ensure => present,
}
}
class mysql{
file{
"/etc/mysql/my.cnf":
mode => 644,
owner => root,
group => root,
source => "/vagrant/manifests/configurations/my.cnf"
}
package { "mysql-server":
ensure => present,
}
service { "mysql":
ensure => running,
require => Package["mysql-server"],
}
}
include base
include http
include php
include mysql
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.forward_port 80, 8080
config.vm.forward_port 3306, 8336
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "default.pp"
end
config.vm.network :hostonly, "10.0.0.24"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment