sudo apt-get install apache2
sudo nano /etc/apache2/sites-enable/somesite
sudo service apache2 restart
package {'apache2':
ensure => installed
}
service {'apache2':
ensure => running
}
file {'/etc/apache2/sites-enable/somesite':
content => 'somecontent',
notify => Service['apache2']
}
file {'/etc/apache2/sites-enable/someothersite':
source => template('module/templatename'),
notify => Service['apache2']
}
architecture => amd64
hostname => gabriel-dev
lsbdistcodename => saucy
lsbdistid => Ubuntu
lsbdistrelease => 13.10
osfamily => Debian
is_virtual => true
virtual => virtualbox
if $::osfamily == 'RedHat' or $::operatingsystem == 'amazon' {
$package = 'httpd'
} elsif $::osfamily == 'Debian' {
$package = 'apache2'
} elsif $::osfamily == 'Archlinux' {
$package = 'apache'
} else {
fail("Unsupported osfamily: ${::osfamily}")
}
if $::osfamily == 'RedHat' or $::operatingsystem == 'amazon' { $package = 'httpd' } elsif $::osfamily == 'Debian' { $package = 'apache2' } elsif $::osfamily == 'Archlinux' { $package = 'apache' } else { fail("Unsupported osfamily: ${::osfamily}") }package {$package: ensure => installed }service {$package: ensure => running, require => Package[$package] } file {'/etc/apache2/sites-enable/somesite': content => 'somecontent', notify => Service[$package] } file {'/etc/apache2/sites-enable/someothersite': source => template('module/templatename'), notify => Service[$package] }
class apache::params {
if $::osfamily == 'RedHat' or $::operatingsystem == 'amazon' {
$package = 'httpd'
$httpd_dir = '/etc/httpd'
$vhost_dir = "${httpd_dir}/conf.d"
} elsif $::osfamily == 'Debian' {
$package = 'apache2'
$httpd_dir = '/etc/apache2'
$vhost_dir = "${httpd_dir}/sites-available"
} elsif $::osfamily == 'Archlinux' {
$package = 'apache'
$httpd_dir = '/etc/apache'
$vhost_dir = "${httpd_dir}/conf.d"
} else {
fail("Unsupported osfamily: ${::osfamily}")
}
}
include apache::paramspackage {$apache::params::package: ensure => installed }service {$apache::params::package:ensure => running, require => Package[$apache::params::package]} file {"${apache::params::vhost_dir}/somesite": content => 'somecontent', notify => Service[$apache::params::package]} file {"${apache::params::vhost_dir}/someothersite":source => template('module/templatename'), notify => Service[$apache::params::package]}
Vagrant.configure("2") do |config|
config.vm.box = "lamp base 1"
config.vm.box_url = "https://some.host.com/lampbase.box"
config.vm.network :private_network, ip: "5.5.5.5"
config.vm.hostname = "lampy.dev"
config.vm.synced_folder "~/Dropbox/code", "/code", type: "nfs"
config.vm.provision :puppet, :module_path => "~/puppet/modules" do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "init.pp"
end
end
Vagrant.configure("2") do |config| # bring them up in these order # db cdn services web pound config.vm.define :db do |db| db.vm.box = "Ubuntu 12.10 Quantal x86_64 (Guest Additions 4.2.2)" db.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box" db.vm.network :private_network, ip: "10.11.12.43" db.vm.hostname = "stagingmysql.icheev.com" db.vm.synced_folder "~/Dropbox/GoMADTech/code", "/code", :nfs => true db.vm.provision :puppet, :module_path => "~/Dropbox/GoMADTech/boxen/puppet/modules" do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "db.pp" end end config.vm.define :cdn do |cdn| cdn.vm.box = "Ubuntu 12.10 Quantal x86_64 (Guest Additions 4.2.2)" cdn.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box" cdn.vm.network :private_network, ip: "10.11.12.42" cdn.vm.hostname = "stagingcdn.icheev.com" cdn.vm.synced_folder "~/Dropbox/GoMADTech/code", "/code", :nfs => true cdn.vm.provision :puppet, :module_path => "~/Dropbox/GoMADTech/boxen/puppet/modules" do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "cdn.pp" end end config.vm.define :services do |services| services.vm.box = "Ubuntu 12.10 Quantal x86_64 (Guest Additions 4.2.2)" services.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box" services.vm.network :private_network, ip: "10.11.12.44" services.vm.hostname = "stagingservices.icheev.com" services.vm.synced_folder "~/Dropbox/GoMADTech/code", "/code", :nfs => true services.vm.provision :puppet, :module_path => "~/Dropbox/GoMADTech/boxen/puppet/modules" do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "services.pp" end end config.vm.define :web do |web| web.vm.box = "Ubuntu 12.10 Quantal x86_64 (Guest Additions 4.2.2)" web.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box" web.vm.network :private_network, ip: "10.11.12.41" web.vm.hostname = "staging.icheev.com" web.vm.synced_folder "~/Dropbox/GoMADTech/code", "/code", :nfs => true web.vm.provision :puppet, :module_path => "~/Dropbox/GoMADTech/boxen/puppet/modules" do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "web.pp" end end config.vm.define :pound do |pound| pound.vm.box = "Ubuntu 12.10 Quantal x86_64 (Guest Additions 4.2.2)" pound.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box" pound.vm.network :private_network, ip: "10.11.12.40" pound.vm.hostname = "stagingpound.icheev.com" pound.vm.synced_folder "~/Dropbox/GoMADTech/code", "/code", :nfs => true pound.vm.provision :puppet, :module_path => "~/Dropbox/GoMADTech/boxen/puppet/modules" do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "pound.pp" end end end
{
"builders": [{
"type" : "digitalocean",
"client_id" : "clientid",
"api_key" : "apikey",
"image_id" : 1505699,
"region_id" : 5,
"size_id" : 64,
"snapshot_name" : "test-snap",
"droplet_name" : "test.jeepers.com"
}],
"provisioners": [{
"type": "shell",
"execute_command": "echo 'vagrant' | sudo -S sh '{{ .Path }}'",
"inline": [
"apt-get update -y",
"apt-get install -y linux-headers-$(uname -r) build-essential dkms puppet-common subversion ruby-hiera",
"apt-get clean"
]
},{
"type" : "puppet-masterless",
"manifest_file" : "manifests/site.pp",
"module_paths" : ["../../puppet/modules"],
"facter" : { "fqdn" : "test.jeepers.com" }
}]
}
{
"builders": [{
"type" : "virtualbox-iso",
"iso_url" : "http://releases.ubuntu.com/13.10/ubuntu-13.10-server-amd64.iso",
"iso_checksum" : "4d1a8b720cdd14b76ed9410c63a00d0e",
"iso_checksum_type" : "md5",
"disk_size" : 80000,
"guest_os_type" : "Ubuntu_64",
"http_directory" : "preseed",
"ssh_username" : "vagrant",
"ssh_password" : "vagrant",
"output_directory" : "output/13.10_5.5_64_virtualbox",
"boot_command" : [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_GB auto locale=en_GB kbd-chooser/method=uk ",
"hostname={{ .Name }} ",
"fb=false debconf/frontend=noninteractive ",
"leopard-configuration/modelcode=SKIP leopard-configuration/layout=GB ",
"leopard-configuration/variant=GB console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
],
"vboxmanage" : [
["modifyvm", "{{.Name}}", "--memory", "1024"]
],
"shutdown_command" : "echo 'shutdown -P now' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'"
}],
"provisioners" : [{
"type": "shell",
"execute_command": "echo 'vagrant' | sudo -S sh '{{ .Path }}'",
"inline": [
"apt-get update -y",
"apt-get install -y linux-headers-$(uname -r) build-essential dkms puppet-common nfs-kernel-server nfs-common ruby-hiera",
"apt-get clean",
"mount -o loop VBoxGuestAdditions.iso /media/cdrom",
"sh /media/cdrom/VBoxLinuxAdditions.run",
"umount /media/cdrom",
"mkdir ~/.ssh",
"wget -qO- https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub >> ~/.ssh/authorized_keys",
"echo 'vagrant ALL=NOPASSWD:ALL' > /tmp/vagrant",
"chmod 0440 /tmp/vagrant",
"mv /tmp/vagrant /etc/sudoers.d/"
]
},{
"type" : "puppet-masterless",
"manifest_file" : "manifests/site.pp",
"module_paths" : ["../../puppet/modules","../../../puppet"],
"facter" : {
"fqdn" : "serverbase.dev"
}
}],
"post-processors" : [
{
"type" : "vagrant",
"only" : ["virtualbox-iso"],
"output" : "output/ubuntu_13.10_5.5_base_v2.box"
}
]
}