Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure the VM also on vagrant provision #12

Merged
merged 1 commit into from
Jul 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 0.3.1 / _Unreleased_

- Configure the VM also on `vagrant provision` ([GH-12][])
* Hook to all commands that trigger provisioning action

# 0.3.0 / 2013-07-12

Expand Down Expand Up @@ -32,3 +34,4 @@
[GH-9]: https://github.com/tmatilai/vagrant-proxyconf/issues/9 "Issue 9"
[GH-10]: https://github.com/tmatilai/vagrant-proxyconf/issues/10 "Issue 10"
[GH-11]: https://github.com/tmatilai/vagrant-proxyconf/issues/11 "Issue 11"
[GH-12]: https://github.com/tmatilai/vagrant-proxyconf/issues/12 "Issue 12"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ vagrant plugin install vagrant-proxyconf

## Usage

The plugin hooks itself to `vagrant up`, `vagrant reload` and `vagrant rebuild` commands.
The plugin hooks itself to all Vagrant commands triggering provisioning (e.g. `vagrant up`, `vagrant provision`, etc.). The proxy configurations are written just before provisioners are run.

Proxy settings can be configured in Vagrantfile. In the common case that you want to use the same configuration in all Vagrant machines, you can use _$HOME/.vagrant.d/Vagrantfile_ or environment variables. Package manager specific settings are only used on supporting platforms (i.e. Apt configuration on Debian based systems), so there is no harm using global configuration.

Expand Down
6 changes: 1 addition & 5 deletions lib/vagrant-proxyconf/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def self.check_vagrant_version!
Cap::Debian::AptProxyConf
end

proxyconf_action_hook = lambda do |hook|
action_hook 'proxyconf_configure' do |hook|
require_relative 'action/configure_apt_proxy'
hook.after Vagrant::Action::Builtin::Provision, Action::ConfigureAptProxy

Expand All @@ -44,10 +44,6 @@ def self.check_vagrant_version!
hook.after VagrantPlugins::AWS::Action::TimedProvision, Action::ConfigureAptProxy
end
end
action_hook 'proxyconf-machine-up', :machine_action_up, &proxyconf_action_hook
action_hook 'proxyconf-machine-reload', :machine_action_reload, &proxyconf_action_hook
# Hook to vagrant-digitalocean's `rebuild` command
action_hook 'proxyconf-machine-rebuild', :machine_action_rebuild, &proxyconf_action_hook
end
end
end