Skip to content

Instantly share code, notes, and snippets.

@marzocchi
Last active December 17, 2015 03:08
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 marzocchi/5540496 to your computer and use it in GitHub Desktop.
Save marzocchi/5540496 to your computer and use it in GitHub Desktop.
Vagrantfile and Puppet manifest
$home = '/home/vagrant'
Package {
require => Exec["apt-get update"]
}
user { "vagrant":
shell => "/usr/bin/zsh",
require => Package["zsh"]
}
exec { "apt-get update":
command => 'apt-get update && touch /var/tmp/apt-updated',
path => '/usr/bin',
unless => "test -f /var/tmp/apt-updated"
}
package { [ "zsh", "curl", "vim" , "git", "tmux", "ranger" ]:
ensure => "present"
}
package { [ "php5", "php5-cli", "php5-curl", "php5-mysql", "php5-pgsql", "php5-xdebug" ]:
ensure => "present"
}
package { ["apache2", "postgresql-9.1", "mysql-server-5.5", "mysql-client-5.5" ]:
ensure => "present"
}
exec { "install shell dot files":
command => "git clone https://github.com/marzocchi/dotfiles-zsh.git $home/.dotfiles --recursive",
require => Package['git'],
unless => "test -d $home/.dotfiles",
path => ["/bin", "/usr/bin"]
}
file { "$home/.zshrc":
ensure => "link",
target => "$home/.dotfiles/.zshrc"
}
file { "$home/.tmux.conf":
ensure => "link",
target => "$home/.dotfiles/.tmux.conf"
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.hostname = 'vagrant-test'
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
config.vm.provider :virtualbox do |vb|
vb.gui = false
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.name = 'vagrant-test'
end
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
config.vm.network :forwarded_port, :guest => 80, :host => 8888
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network :private_network, :ip => "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network :public_network
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Enable provisioning with Puppet stand alone.
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "."
puppet.manifest_file = "manifest.pp"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment