Skip to content

Instantly share code, notes, and snippets.

@Martin1982
Last active August 29, 2015 14:00
Show Gist options
  • Save Martin1982/191276e333a5e4c7feac to your computer and use it in GitHub Desktop.
Save Martin1982/191276e333a5e4c7feac to your computer and use it in GitHub Desktop.
Shell Provisioner for Vagrant with Ansible on Windows Hosts
#!/usr/bin/env bash
# Assumes apt is available and has a source with the Ansible package
sudo apt-get update
sudo apt-get install ansible -y
# hosts file with only the text '127.0.0.1', change path accordingly
# required because Windows makes files executable by default which Ansible doesn't like
sudo cp /vagrant/provisioning/hosts /tmp
chmod 666 /tmp/hosts
# Again change path to your playbook accordingly
sudo ansible-playbook /vagrant/provisioning/playbook.yml -i /tmp/hosts --connection=local
@Martin1982
Copy link
Author

Of course apt-get assumes a guest that has apt ;) Feel free to expand this script to your needs

@relaxnow
Copy link

relaxnow commented May 2, 2014

666 👹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment