-
-
Save epmatsw/25009943312e44a31e60 to your computer and use it in GitHub Desktop.
Vagrant box to compile stasis projects (gems: stasis, haml, coffee-script, sass, rhc).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$as_vagrant = 'sudo -u vagrant -H bash -l -c' | |
$home = '/home/vagrant' | |
Exec { | |
path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin'] | |
} | |
# --- Preinstall Stage --------------------------------------------------------- | |
stage { 'preinstall': | |
before => Stage['main'] | |
} | |
class apt_get_update { | |
exec { 'apt-get -y update': | |
unless => "test -e ${home}/.rvm" | |
} | |
} | |
class { 'apt_get_update': | |
stage => preinstall | |
} | |
# --- Packages ----------------------------------------------------------------- | |
package { 'curl': | |
ensure => installed | |
} | |
package { 'build-essential': | |
ensure => installed | |
} | |
package { 'git-core': | |
ensure => installed | |
} | |
# ExecJS runtime. | |
package { 'nodejs': | |
ensure => installed | |
} | |
# --- Ruby --------------------------------------------------------------------- | |
exec { 'install_rvm': | |
command => "${as_vagrant} 'curl -L https://get.rvm.io | bash -s stable'", | |
creates => "${home}/.rvm", | |
require => Package['curl'] | |
} | |
exec { 'install_ruby': | |
command => "${as_vagrant} '${home}/.rvm/bin/rvm install 1.9.3p545 --latest-binary --autolibs=enabled && rvm --fuzzy alias create default 1.9.3p545'", | |
creates => "${home}/.rvm/bin/ruby", | |
require => Exec['install_rvm'] | |
} | |
exec { "${as_vagrant} 'gem install bundler --no-rdoc --no-ri'": | |
creates => "${home}/.rvm/bin/bundle", | |
require => Exec['install_ruby'] | |
} | |
exec { "${as_vagrant} 'gem install sass-globbing --pre --no-rdoc --no-ri'": | |
require => Exec['install_ruby'] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network :forwarded_port, guest: 4000, host: 4000 | |
config.vm.hostname = 'tnw-box' | |
config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "puppet/manifests" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment