Skip to content

Commit

Permalink
Use Vagrant 1.7 ability to install Chef if needed
Browse files Browse the repository at this point in the history
Only require the vagrant-omnibus plugin with older Vagrant versions.
  • Loading branch information
tmatilai committed Jul 24, 2015
1 parent 7fbf64c commit 812dcf0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2013-2014 Teemu Matilainen <teemu.matilainen@iki.fi>
Copyright (c) 2013-2015 Teemu Matilainen <teemu.matilainen@iki.fi>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -2,7 +2,7 @@

Example setup for running [polipo](http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/) proxy server in a [Vagrant](http://www.vagrantup.com/) box.

This can be used in combination with [vagrant-proxyconf][proxyconf] plugin to cache most HTTP traffic of the VMs to speed up Vagrant usage. The configuration should be easy to customize either as well for local machines as for cloud providers.
This can be used in combination with the [vagrant-proxyconf][proxyconf] plugin to cache most HTTP traffic of the VMs to speed up Vagrant usage. The configuration should be easy to customize either as well for local machines as for cloud providers.

Polipo does its best also when offline. But as it can't cache HTTPS traffic, you might want to use [vagrant-cachier](https://github.com/fgrehm/vagrant-cachier) in combination with vagrant-proxyconf if you aim to use Vagrant without internet connection at times.

Expand All @@ -11,7 +11,8 @@ Note that the example configuration allows access from everywhere. That should b
## Usage

* Install Vagrant 1.2 or later: [www.vagrantup.com/downloads](http://www.vagrantup.com/downloads)
* Install Vagrant plugins:

* With Vagrant versions older than 1.7, install the vagrant-omnibus plugin:

vagrant plugin install vagrant-omnibus

Expand All @@ -27,7 +28,7 @@ Note that the example configuration allows access from everywhere. That should b

### Configuring vagrant-proxyconf

* Install vagrant-proxyconf plugin:
* Install the vagrant-proxyconf plugin:

vagrant plugin install vagrant-proxyconf

Expand Down
11 changes: 9 additions & 2 deletions Vagrantfile
Expand Up @@ -10,8 +10,15 @@ Vagrant.configure("2") do |config|
# Disable default share
config.vm.synced_folder '.', '/vagrant', disabled: true

# Configure plugins
config.omnibus.chef_version = :latest
# Ensure that Chef is installed. Vagrant 1.7+ does it natively, with older
# versions we require the vagrant-omnibus plugin
if Gem::Version.new(Vagrant::VERSION) < Gem::Version.new('1.7')
if Vagrant.has_plugin?('vagrant-omnibus')
config.omnibus.chef_version = :latest
else
raise('Please upgrade Vagrant to version 1.7 or newer, or install the "vagrant-omnibus" plugin')
end
end

# Disable the vagrant-proxyconf plugin, as the proxy might not
# have been installed or configured yet.
Expand Down

0 comments on commit 812dcf0

Please sign in to comment.