Skip to content

Instantly share code, notes, and snippets.

@smerrill
Last active August 29, 2015 14:23
Show Gist options
  • Save smerrill/73f6f74707ce644ba2cc to your computer and use it in GitHub Desktop.
Save smerrill/73f6f74707ce644ba2cc to your computer and use it in GitHub Desktop.
Run Ansible on the Vagrant guest if you're on Windows.
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
# These lines are for testing gatling-rsync-auto on Windows; you can probably comment
# them out and just have ansible-playbook look for /vagrant/playbook.yml.
config.vm.synced_folder "files", "/opt/vagrant/rsynced_folder", type: "rsync"
config.gatling.rsync_on_startup = true
# On Windows, run ansible in the VM.
if RUBY_PLATFORM =~ /mswin|mingw|cygwin/ then
config.vm.provision "shell", inline: <<EOF
yum -y install epel-release
yum -y update
yum -y install ansible
ansible-playbook -i "localhost," -c local /home/vagrant/sync/playbook.yml
EOF
else
config.vm.provision "ansible"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment