Created
March 27, 2013 17:02
-
-
Save gaffneyc/5256027 to your computer and use it in GitHub Desktop.
Vagrant Shell provisioning to replace default chef install with omnibus installer. Tested on the default precise64 boxes provided for Vagrant.
This file contains hidden or 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
Vagrant::Config.run("2") do |config| | |
# Clean up the default image to remove some default puppet, chef, and ruby. | |
config.vm.provision :shell do |shell| | |
shell.inline = <<-EOF.gsub(/^ +/, "") | |
# Make sure vagrant always has sudo access | |
( cat << 'EOP' | |
Defaults exempt_group=vagrant | |
%vagrant ALL=NOPASSWD:ALL | |
EOP | |
) > /etc/sudoers.d/vagrant | |
chmod 0440 /etc/sudoers.d/vagrant | |
# Remove vagrant path changes (not using the default install) | |
if [ -f /etc/profile.d/vagrantruby.sh ]; then | |
rm /etc/profile.d/vagrantruby.sh | |
fi | |
# Remove vagrant default executables (again, not using them) | |
if [ -d /opt/ruby ]; then | |
rm -rf /opt/ruby | |
fi | |
# Install chef omnibus package | |
if [ ! -d /opt/chef ]; then | |
wget -q -O- https://www.opscode.com/chef/install.sh | bash | |
fi | |
EOF | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment