Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save markahesketh/53b101148646a61554cc1ab6e9f51dd0 to your computer and use it in GitHub Desktop.
Save markahesketh/53b101148646a61554cc1ab6e9f51dd0 to your computer and use it in GitHub Desktop.
# Use rbconfig to determine if we're on a windows host or not.
require 'rbconfig'
is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
if is_windows
# Provisioning configuration for shell script.
config.vm.provision "shell" do |sh|
sh.path = "windows.sh"
sh.args = "build.yml"
end
else
# Provisioning configuration for Ansible (for Mac/Linux hosts).
config.vm.provision "ansible" do |ansible|
ansible.inventory_path = "./hosts/local"
ansible.playbook = "build.yml"
ansible.sudo = true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment