Advertisement
clockworkpc

Vagrantfile for CentOS7

Oct 2nd, 2016
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.12 KB | None | 0 0
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3.  
  4. Vagrant.configure("2") do |config|
  5.  
  6.   required_plugins = %w(vagrant-share vagrant-vbguest vagrant-gatling-rsync)
  7.   plugins_to_install = required_plugins.select { |plugin| not Vagrant.has_plugin? plugin }
  8.   if not plugins_to_install.empty?
  9.     puts "Installing plugins: #{plugins_to_install.join(' ')}"
  10.     if system "vagrant plugin install #{plugins_to_install.join(' ')}"
  11.       exec "vagrant #{ARGV.join(' ')}"
  12.     else
  13.       abort "Installation of one or more plugins has failed. Aborting."
  14.     end
  15.   end
  16.  
  17.   # Use the Centos7 Box from public repository
  18.   config.vm.box = "centos/7"
  19.  
  20.   # Disable the newly added feature of generating a new SSH key
  21.   config.ssh.insert_key = false
  22.  
  23.   # Port mapping from guest to host, as per the specifications sheet
  24.   config.vm.network "forwarded_port", guest: 80, host: 8888
  25.  
  26.   # Temporarily disable vagrant-gatling-rsync until I sort out the bootstrap
  27.   config.gatling.rsync_on_startup = false
  28.  
  29.   # Execute bootstrap.sh to install the applications, as per the specifications sheet
  30.   config.vm.provision :shell, path: "bootstrap.sh"
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement