Last active
May 9, 2017 20:47
-
-
Save avtar/2927b81f9de108a91818 to your computer and use it in GitHub Desktop.
Vagrant shell provisioner that runs ansible-playbook
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
#!/bin/sh | |
# Enable the EPEL repository | |
if [ ! -f /etc/yum.repos.d/epel.repo ]; then | |
sudo yum -y install epel-release | |
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 | |
fi | |
sudo yum -y install gcc python-devel python-pip | |
sudo pip install ansible | |
# Workaround for https://github.com/mitchellh/vagrant/issues/2103 | |
sudo ansible-playbook /vagrant/site.yml -i /vagrant/hosts --connection=local |
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 : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "chef/centos-7.0" | |
config.vm.network "forwarded_port", guest: 8080, host: 8080 | |
config.vm.provision :shell, :path => "bootstrap.sh" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment