Skip to content

Instantly share code, notes, and snippets.

@rogeriopradoj
Created April 12, 2012 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogeriopradoj/2363673 to your computer and use it in GitHub Desktop.
Save rogeriopradoj/2363673 to your computer and use it in GitHub Desktop.
Vagrantfile e duodraco.pp
class base {
group { "puppet":
ensure => "present",
}
# put this somewhere global, like site.pp
Exec { path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" }
exec { "apt_update":
command => "sudo apt-get update",
path => "/usr/bin",
require => Group["puppet"],
}
package { "openssh-server":
ensure => present,
require => Exec["apt_update"],
}
package { "make":
ensure => present,
require => Package["openssh-server"],
}
package { "build-essential":
ensure => present,
require => Package["make"],
}
package { "dkms":
ensure => present,
require => Package["build-essential"],
}
package { "php-pear":
ensure => present,
require => Package["dkms"],
}
package { "php5-cli":
ensure => present,
require => Package["php-pear"],
}
package { "php5-curl":
ensure => present,
require => Package["php5-cli"],
}
package { "php5-dbg":
ensure => present,
require => Package["php5-curl"],
}
package { "php5-dev":
ensure => present,
require => Package["php5-dbg"],
}
package { "php5-gd":
ensure => present,
require => Package["php5-dev"],
}
package { "php5-mysql":
ensure => present,
require => Package["php5-gd"],
}
package { "php5-sqlite":
ensure => present,
require => Package["php5-mysql"],
}
package { "php5-xsl":
ensure => present,
require => Package["php5-sqlite"],
}
package { "php-apc":
ensure => present,
require => Package["php5-xsl"],
}
package { "php5-fpm":
ensure => present,
require => Package["php-apc"],
}
package { "apache2":
ensure => present,
require => Package["php5-fpm"],
}
package { "apache2-mpm-event":
ensure => present,
require => Package["apache2"],
}
package { "apache2-utils":
ensure => present,
require => Package["apache2-mpm-event"],
}
package { "libapache2-mod-fastcgi":
ensure => present,
require => Package["apache2-utils"],
}
package { "avahi-daemon":
ensure => present,
require => Package["libapache2-mod-fastcgi"],
}
file { "/etc/apache2/sites-available/teste":
ensure => "link",
target => "/vagrant/teste",
require => Package["avahi-daemon"],
}
exec { "tira_site_padrao":
command => "a2dissite default",
require => File["/etc/apache2/sites-available/teste"],
}
exec { "inclui_site_teste":
command => "a2ensite teste",
require => Exec["tira_site_padrao"],
}
exec { "inclui_modulo_actions":
command => "a2enmod actions",
require => Exec["inclui_site_teste"],
}
exec { "reinicia_apache":
command => "sudo service apache2 restart",
require => Exec["inclui_modulo_actions"],
}
exec { "reinicia_fpm":
command => "sudo service php5-fpm restart",
require => Exec["reinicia_apache"],
}
service { "apache2":
ensure => running,
require => Package["apache2"],
}
service { "php5-fpm":
ensure => running,
require => Package["php5-fpm"],
}
service { "avahi-daemon":
ensure => running,
require => Package["avahi-daemon"],
}
}
include base
// Tentando acessar o endereço http://duodraco.local
Not Found
The requested URL /usr/lib/cgi-bin/php5.external/index.php was not found on this server.
Apache/2.2.20 (Ubuntu) Server at duodraco.local Port 80
<?php
echo "Hello World!";
phpinfo();
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
# config.vm.box = "base"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
# config.vm.box_url = "http://domain.com/path/to/above.box"
# Boot with a GUI so you can see the screen. (Default is headless)
# config.vm.boot_mode = :gui
# Assign this VM to a host-only network IP, allowing you to access it
# via the IP. Host-only networks can talk to the host machine as well as
# any other machines on the same network, but cannot be accessed (through this
# network interface) by any external networks.
# config.vm.network :hostonly, "33.33.33.10"
# Assign this VM to a bridged network, allowing you to connect directly to a
# network using the host's network device. This makes the VM appear as another
# physical device on your network.
# config.vm.network :bridged
# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
# config.vm.forward_port 80, 8080
# Share an additional folder to the guest VM. The first argument is
# an identifier, the second is the path on the guest to mount the
# folder, and the third is the path on the host to the actual folder.
# config.vm.share_folder "v-data", "/vagrant_data", "../data"
# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file base.pp in the manifests_path directory.
#
# An example Puppet manifest to provision the message of the day:
#
# # group { "puppet":
# # ensure => "present",
# # }
# #
# # File { owner => 0, group => 0, mode => 0644 }
# #
# # file { '/etc/motd':
# # content => "Welcome to your Vagrant-built virtual machine!
# # Managed by Puppet.\n"
# # }
#
#config.vm.provision :puppet do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "base.pp"
#end
# Enable provisioning with chef solo, specifying a cookbooks path (relative
# to this Vagrantfile), and adding some recipes and/or roles.
#
# config.vm.provision :chef_solo do |chef|
# chef.cookbooks_path = "cookbooks"
# chef.add_recipe "mysql"
# chef.add_role "web"
#
# # You may also specify custom JSON attributes:
# chef.json = { :mysql_password => "foo" }
# end
# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
# The Opscode Platform uses HTTPS. Substitute your organization for
# ORGNAME in the URL and validation key.
#
# If you have your own Chef Server, use the appropriate URL, which may be
# HTTP instead of HTTPS depending on your configuration. Also change the
# validation key to validation.pem.
#
# config.vm.provision :chef_client do |chef|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
# chef.validation_key_path = "ORGNAME-validator.pem"
# end
#
# If you're using the Opscode platform, your validator client is
# ORGNAME-validator, replacing ORGNAME with your organization name.
#
# IF you have your own Chef Server, the default validation client name is
# chef-validator, unless you changed the configuration.
#
# chef.validation_client_name = "ORGNAME-validator"
# config para a máquina do eminetto
#config.vm.define "eminetto" do |app|
# app.vm.boot_mode = :gui
# app.vm.host_name = "eminetto"
# app.vm.forward_port 80, 8080
# app.vm.provision :puppet do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "base.pp"
# end
#end
# config para a máquina do duodraco
config.vm.define "duodraco" do |duodraco|
duodraco.vm.box = "ubuntu-1110-server-amd64"
duodraco.vm.boot_mode = :gui
duodraco.vm.host_name = "duodraco"
duodraco.vm.network :hostonly, "33.33.33.10"
duodraco.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "duodraco.pp"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment