landrush 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +14 -6
- data/README.md +7 -1
- data/issues/vbox/Vagrantfile +122 -0
- data/landrush.gemspec +8 -11
- data/lib/landrush/action/common.rb +11 -5
- data/lib/landrush/action/setup.rb +6 -5
- data/lib/landrush/action/teardown.rb +1 -1
- data/lib/landrush/config.rb +1 -1
- data/lib/landrush/resolver_config.rb +1 -1
- data/lib/landrush/version.rb +1 -1
- data/test/landrush/action/setup_test.rb +9 -9
- data/test/landrush/action/teardown_test.rb +9 -9
- data/test/landrush/server_test.rb +3 -0
- data/test/test_helper.rb +24 -17
- metadata +15 -58
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e693be4f12a2d3c0da6eb23fb684e58264bc51f0
|
4
|
+
data.tar.gz: bd61f14b00d88dd191db6db4e66a2f863b86fb37
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7374e121ae3e787f8283252a62eafb0cdd4f3537f7708074fa18f8fcc8794b89db3d937e16ec46226ae72fb52543457a3cbc7c52d24650d7c3b76f29f43f94c5
|
7
|
+
data.tar.gz: d3366905659e8f9ea6b4deec79c850ff842c2e7812c981baa6c789ce9c5e0d2d1671e13f3b33324d6628c9e08c7a8c75ffdc518cfe752e2d56dfe6aca5d95a2e
|
data/Gemfile
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gemspec
|
3
|
+
# Can't use `gemspec` to pull in dependencies, because the landrush gem needs
|
4
|
+
# to be in the :plugins group for Vagrant to detect and load it in development
|
5
|
+
|
6
|
+
gem 'rubydns', '0.7.0'
|
7
|
+
gem 'rake'
|
8
|
+
|
9
|
+
# Vagrant's special group
|
10
|
+
group :plugins do
|
11
|
+
gem 'landrush', path: '.'
|
12
|
+
end
|
4
13
|
|
5
14
|
group :development do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
|
15
|
+
gem 'vagrant',
|
16
|
+
:git => 'git://github.com/mitchellh/vagrant.git',
|
17
|
+
:ref => 'v1.5.1'
|
10
18
|
|
11
|
-
gem
|
19
|
+
gem 'byebug'
|
12
20
|
end
|
data/README.md
CHANGED
@@ -68,7 +68,13 @@ Linux guests should automatically have their DNS traffic redirected via `iptable
|
|
68
68
|
|
69
69
|
If you're on an OS X host, we use a nice trick to unobtrusively add a secondary DNS server only for specific domains.
|
70
70
|
|
71
|
-
Similar behavior can
|
71
|
+
Similar behavior can be achieved on Linux hosts with `dnsmasq`. You can integrate Landrush with dnsmasq on Ubuntu like so (tested on Ubuntu 13.10):
|
72
|
+
|
73
|
+
sudo apt-get install -y resolvconf dnsmasq
|
74
|
+
sudo sh -c 'echo "server=/vagrant.dev/127.0.0.1#10053" > /etc/dnsmasq.d/vagrant-landrush'
|
75
|
+
sudo service dnsmasq restart
|
76
|
+
|
77
|
+
If you use a TLD other than the default `vagrant.dev`, replace the TLD in the above instructions accordingly. Please be aware that anything ending in '.local' as TLD will not work because the `avahi` daemon reserves this TLD for its own uses.
|
72
78
|
|
73
79
|
### Additional CLI commands
|
74
80
|
|
@@ -0,0 +1,122 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
+
VAGRANTFILE_API_VERSION = "2"
|
6
|
+
ENV.delete 'VAGRANT_DEFAULT_PROVIDER'
|
7
|
+
|
8
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
9
|
+
# All Vagrant configuration is done here. The most common configuration
|
10
|
+
# options are documented and commented below. For a complete reference,
|
11
|
+
# please see the online documentation at vagrantup.com.
|
12
|
+
|
13
|
+
# Every Vagrant virtual environment requires a box to build off of.
|
14
|
+
config.vm.box = 'precise64'
|
15
|
+
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
|
16
|
+
config.vm.hostname = 'vbox.vagrant.dev'
|
17
|
+
config.landrush.enable
|
18
|
+
|
19
|
+
# The url from where the 'config.vm.box' box will be fetched if it
|
20
|
+
# doesn't already exist on the user's system.
|
21
|
+
# config.vm.box_url = "http://domain.com/path/to/above.box"
|
22
|
+
|
23
|
+
# Create a forwarded port mapping which allows access to a specific port
|
24
|
+
# within the machine from a port on the host machine. In the example below,
|
25
|
+
# accessing "localhost:8080" will access port 80 on the guest machine.
|
26
|
+
# config.vm.network :forwarded_port, guest: 80, host: 8080
|
27
|
+
|
28
|
+
# Create a private network, which allows host-only access to the machine
|
29
|
+
# using a specific IP.
|
30
|
+
# config.vm.network :private_network, ip: "192.168.33.10"
|
31
|
+
|
32
|
+
# Create a public network, which generally matched to bridged network.
|
33
|
+
# Bridged networks make the machine appear as another physical device on
|
34
|
+
# your network.
|
35
|
+
# config.vm.network :public_network
|
36
|
+
|
37
|
+
# If true, then any SSH connections made will enable agent forwarding.
|
38
|
+
# Default value: false
|
39
|
+
# config.ssh.forward_agent = true
|
40
|
+
|
41
|
+
# Share an additional folder to the guest VM. The first argument is
|
42
|
+
# the path on the host to the actual folder. The second argument is
|
43
|
+
# the path on the guest to mount the folder. And the optional third
|
44
|
+
# argument is a set of non-required options.
|
45
|
+
# config.vm.synced_folder "../data", "/vagrant_data"
|
46
|
+
|
47
|
+
# Provider-specific configuration so you can fine-tune various
|
48
|
+
# backing providers for Vagrant. These expose provider-specific options.
|
49
|
+
# Example for VirtualBox:
|
50
|
+
#
|
51
|
+
# config.vm.provider :virtualbox do |vb|
|
52
|
+
# # Don't boot with headless mode
|
53
|
+
# vb.gui = true
|
54
|
+
#
|
55
|
+
# # Use VBoxManage to customize the VM. For example to change memory:
|
56
|
+
# vb.customize ["modifyvm", :id, "--memory", "1024"]
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# View the documentation for the provider you're using for more
|
60
|
+
# information on available options.
|
61
|
+
|
62
|
+
# Enable provisioning with Puppet stand alone. Puppet manifests
|
63
|
+
# are contained in a directory path relative to this Vagrantfile.
|
64
|
+
# You will need to create the manifests directory and a manifest in
|
65
|
+
# the file base.pp in the manifests_path directory.
|
66
|
+
#
|
67
|
+
# An example Puppet manifest to provision the message of the day:
|
68
|
+
#
|
69
|
+
# # group { "puppet":
|
70
|
+
# # ensure => "present",
|
71
|
+
# # }
|
72
|
+
# #
|
73
|
+
# # File { owner => 0, group => 0, mode => 0644 }
|
74
|
+
# #
|
75
|
+
# # file { '/etc/motd':
|
76
|
+
# # content => "Welcome to your Vagrant-built virtual machine!
|
77
|
+
# # Managed by Puppet.\n"
|
78
|
+
# # }
|
79
|
+
#
|
80
|
+
# config.vm.provision :puppet do |puppet|
|
81
|
+
# puppet.manifests_path = "manifests"
|
82
|
+
# puppet.manifest_file = "site.pp"
|
83
|
+
# end
|
84
|
+
|
85
|
+
# Enable provisioning with chef solo, specifying a cookbooks path, roles
|
86
|
+
# path, and data_bags path (all relative to this Vagrantfile), and adding
|
87
|
+
# some recipes and/or roles.
|
88
|
+
#
|
89
|
+
# config.vm.provision :chef_solo do |chef|
|
90
|
+
# chef.cookbooks_path = "../my-recipes/cookbooks"
|
91
|
+
# chef.roles_path = "../my-recipes/roles"
|
92
|
+
# chef.data_bags_path = "../my-recipes/data_bags"
|
93
|
+
# chef.add_recipe "mysql"
|
94
|
+
# chef.add_role "web"
|
95
|
+
#
|
96
|
+
# # You may also specify custom JSON attributes:
|
97
|
+
# chef.json = { :mysql_password => "foo" }
|
98
|
+
# end
|
99
|
+
|
100
|
+
# Enable provisioning with chef server, specifying the chef server URL,
|
101
|
+
# and the path to the validation key (relative to this Vagrantfile).
|
102
|
+
#
|
103
|
+
# The Opscode Platform uses HTTPS. Substitute your organization for
|
104
|
+
# ORGNAME in the URL and validation key.
|
105
|
+
#
|
106
|
+
# If you have your own Chef Server, use the appropriate URL, which may be
|
107
|
+
# HTTP instead of HTTPS depending on your configuration. Also change the
|
108
|
+
# validation key to validation.pem.
|
109
|
+
#
|
110
|
+
# config.vm.provision :chef_client do |chef|
|
111
|
+
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
|
112
|
+
# chef.validation_key_path = "ORGNAME-validator.pem"
|
113
|
+
# end
|
114
|
+
#
|
115
|
+
# If you're using the Opscode platform, your validator client is
|
116
|
+
# ORGNAME-validator, replacing ORGNAME with your organization name.
|
117
|
+
#
|
118
|
+
# If you have your own Chef Server, the default validation client name is
|
119
|
+
# chef-validator, unless you changed the configuration.
|
120
|
+
#
|
121
|
+
# chef.validation_client_name = "ORGNAME-validator"
|
122
|
+
end
|
data/landrush.gemspec
CHANGED
@@ -4,12 +4,12 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'landrush/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'landrush'
|
8
8
|
spec.version = Landrush::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Paul Hinze']
|
10
|
+
spec.email = ['paul.t.hinze@gmail.com']
|
11
11
|
spec.description = <<-DESCRIP.gsub(/^ /, '')
|
12
|
-
|
12
|
+
Forget about IPs in Vagrant - Automated DNS for your VMs
|
13
13
|
|
14
14
|
This Vagrant plugin spins up a lightweight DNS server and makes it visible
|
15
15
|
to your guests and your host, so that you can easily access all your
|
@@ -20,16 +20,13 @@ Gem::Specification.new do |spec|
|
|
20
20
|
server as well. See the README for more documentation.
|
21
21
|
DESCRIP
|
22
22
|
spec.summary = %q{a vagrant plugin providing consistent DNS visible on host and guests}
|
23
|
-
spec.homepage =
|
24
|
-
spec.license =
|
23
|
+
spec.homepage = 'https://github.com/phinze/landrush'
|
24
|
+
spec.license = 'MIT'
|
25
25
|
|
26
26
|
spec.files = `git ls-files`.split($/)
|
27
27
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
28
28
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
29
|
-
spec.require_paths = [
|
29
|
+
spec.require_paths = ['lib']
|
30
30
|
|
31
|
-
spec.add_dependency
|
32
|
-
|
33
|
-
spec.add_development_dependency "bundler", "~> 1.3"
|
34
|
-
spec.add_development_dependency "rake"
|
31
|
+
spec.add_dependency 'rubydns', '0.7.0'
|
35
32
|
end
|
@@ -37,20 +37,26 @@ module Landrush
|
|
37
37
|
}
|
38
38
|
end
|
39
39
|
|
40
|
-
def global_config
|
41
|
-
env[:global_config]
|
42
|
-
end
|
43
|
-
|
44
40
|
def machine
|
45
41
|
env[:machine]
|
46
42
|
end
|
47
43
|
|
44
|
+
def config
|
45
|
+
if env.key? :global_config
|
46
|
+
# < Vagrant 1.5
|
47
|
+
env[:global_config].landrush
|
48
|
+
else
|
49
|
+
# >= Vagrant 1.5
|
50
|
+
machine.config.landrush
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
48
54
|
def machine_hostname
|
49
55
|
machine.config.vm.hostname
|
50
56
|
end
|
51
57
|
|
52
58
|
def enabled?
|
53
|
-
|
59
|
+
config.enabled?
|
54
60
|
end
|
55
61
|
|
56
62
|
def info(msg)
|
@@ -12,6 +12,7 @@ module Landrush
|
|
12
12
|
# before the Network action, should mean that all interfaces are good
|
13
13
|
# to go.
|
14
14
|
record_machine_dns_entry if enabled?
|
15
|
+
setup_static_dns if enabled?
|
15
16
|
end
|
16
17
|
|
17
18
|
def pre_boot_setup
|
@@ -20,7 +21,6 @@ module Landrush
|
|
20
21
|
setup_host_resolver
|
21
22
|
configure_server
|
22
23
|
start_server
|
23
|
-
setup_static_dns
|
24
24
|
end
|
25
25
|
|
26
26
|
def record_dependent_vm
|
@@ -39,7 +39,7 @@ module Landrush
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def configure_server
|
42
|
-
Store.config.set('upstream',
|
42
|
+
Store.config.set('upstream', config.upstream_servers)
|
43
43
|
end
|
44
44
|
|
45
45
|
def start_server
|
@@ -50,7 +50,8 @@ module Landrush
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def setup_static_dns
|
53
|
-
|
53
|
+
config.hosts.each do |hostname, dns_value|
|
54
|
+
dns_value ||= machine.guest.capability(:read_host_visible_ip_address)
|
54
55
|
info "adding static entry: #{hostname} => #{dns_value}"
|
55
56
|
Store.hosts.set hostname, dns_value
|
56
57
|
end
|
@@ -61,8 +62,8 @@ module Landrush
|
|
61
62
|
|
62
63
|
info "adding machine entry: #{machine_hostname} => #{ip_address}"
|
63
64
|
|
64
|
-
if not machine_hostname.match(
|
65
|
-
log :error, "hostname #{machine_hostname} does not match the configured TLD: #{
|
65
|
+
if not machine_hostname.match(config.tld)
|
66
|
+
log :error, "hostname #{machine_hostname} does not match the configured TLD: #{config.tld}"
|
66
67
|
log :error, "You will not be able to access #{machine_hostname} from the host"
|
67
68
|
end
|
68
69
|
|
data/lib/landrush/config.rb
CHANGED
data/lib/landrush/version.rb
CHANGED
@@ -9,7 +9,7 @@ module Landrush
|
|
9
9
|
after { ResolverConfig.sudo = 'sudo' }
|
10
10
|
|
11
11
|
it "calls the next app in the chain" do
|
12
|
-
env = fake_environment
|
12
|
+
env = fake_environment
|
13
13
|
app = lambda { |e| e[:called] = true }
|
14
14
|
setup = Setup.new(app, nil)
|
15
15
|
|
@@ -21,7 +21,7 @@ module Landrush
|
|
21
21
|
it "records the booting host as a dependent VM" do
|
22
22
|
app = Proc.new {}
|
23
23
|
setup = Setup.new(app, nil)
|
24
|
-
env =
|
24
|
+
env = fake_environment
|
25
25
|
|
26
26
|
setup.call(env)
|
27
27
|
|
@@ -31,7 +31,7 @@ module Landrush
|
|
31
31
|
it "starts the landrush server if it's not already started" do
|
32
32
|
app = Proc.new {}
|
33
33
|
setup = Setup.new(app, nil)
|
34
|
-
env =
|
34
|
+
env = fake_environment
|
35
35
|
|
36
36
|
setup.call(env)
|
37
37
|
|
@@ -41,7 +41,7 @@ module Landrush
|
|
41
41
|
it "does not attempt to start the server if it's already up" do
|
42
42
|
app = Proc.new {}
|
43
43
|
setup = Setup.new(app, nil)
|
44
|
-
env =
|
44
|
+
env = fake_environment
|
45
45
|
|
46
46
|
Server.start
|
47
47
|
original_pid = Server.pid
|
@@ -55,9 +55,9 @@ module Landrush
|
|
55
55
|
it "does nothing if it is not enabled via config" do
|
56
56
|
app = Proc.new {}
|
57
57
|
setup = Setup.new(app, nil)
|
58
|
-
env =
|
58
|
+
env = fake_environment
|
59
59
|
|
60
|
-
env[:
|
60
|
+
env[:machine].config.landrush.disable
|
61
61
|
setup.call(env)
|
62
62
|
|
63
63
|
DependentVMs.list.must_equal []
|
@@ -67,7 +67,7 @@ module Landrush
|
|
67
67
|
it "stores the machine's hostname => ip address" do
|
68
68
|
app = Proc.new {}
|
69
69
|
setup = Setup.new(app, nil)
|
70
|
-
env =
|
70
|
+
env = fake_environment
|
71
71
|
|
72
72
|
setup.call(env)
|
73
73
|
|
@@ -77,9 +77,9 @@ module Landrush
|
|
77
77
|
it "does nothing if it is not enabled via config" do
|
78
78
|
app = Proc.new {}
|
79
79
|
setup = Setup.new(app, nil)
|
80
|
-
env =
|
80
|
+
env = fake_environment
|
81
81
|
|
82
|
-
env[:
|
82
|
+
env[:machine].config.landrush.disable
|
83
83
|
setup.call(env)
|
84
84
|
|
85
85
|
Store.hosts.get('somehost.vagrant.dev').must_equal nil
|
@@ -6,7 +6,7 @@ module Landrush
|
|
6
6
|
module Action
|
7
7
|
describe Teardown do
|
8
8
|
it "calls the next app in the chain" do
|
9
|
-
env = fake_environment
|
9
|
+
env = fake_environment
|
10
10
|
app = lambda { |e| e[:called] = true }
|
11
11
|
teardown = Teardown.new(app, nil)
|
12
12
|
|
@@ -18,7 +18,7 @@ module Landrush
|
|
18
18
|
it "clears the machine's hostname => ip address" do
|
19
19
|
app = Proc.new {}
|
20
20
|
teardown = Teardown.new(app, nil)
|
21
|
-
env =
|
21
|
+
env = fake_environment
|
22
22
|
|
23
23
|
Store.hosts.set('somehost.vagrant.dev', '1.2.3.4')
|
24
24
|
teardown.call(env)
|
@@ -29,7 +29,7 @@ module Landrush
|
|
29
29
|
it "removes the machine as a dependent VM" do
|
30
30
|
app = Proc.new {}
|
31
31
|
teardown = Teardown.new(app, nil)
|
32
|
-
env =
|
32
|
+
env = fake_environment
|
33
33
|
|
34
34
|
DependentVMs.add('somehost.vagrant.dev')
|
35
35
|
teardown.call(env)
|
@@ -40,7 +40,7 @@ module Landrush
|
|
40
40
|
it "stops the landrush server when there are no dependent machines left" do
|
41
41
|
app = Proc.new {}
|
42
42
|
teardown = Teardown.new(app, nil)
|
43
|
-
env =
|
43
|
+
env = fake_environment
|
44
44
|
|
45
45
|
Server.start
|
46
46
|
teardown.call(env)
|
@@ -51,7 +51,7 @@ module Landrush
|
|
51
51
|
it "leaves the landrush server when other dependent vms exist" do
|
52
52
|
app = Proc.new {}
|
53
53
|
teardown = Teardown.new(app, nil)
|
54
|
-
env =
|
54
|
+
env = fake_environment
|
55
55
|
DependentVMs.add('otherhost.vagrant.dev')
|
56
56
|
|
57
57
|
Server.start
|
@@ -63,7 +63,7 @@ module Landrush
|
|
63
63
|
it "leaves static entries when other dependent vms exist" do
|
64
64
|
app = Proc.new {}
|
65
65
|
teardown = Teardown.new(app, nil)
|
66
|
-
env =
|
66
|
+
env = fake_environment
|
67
67
|
DependentVMs.add('otherhost.vagrant.dev')
|
68
68
|
|
69
69
|
fake_static_entry(env, 'static.vagrant.dev', '3.4.5.6')
|
@@ -76,7 +76,7 @@ module Landrush
|
|
76
76
|
it "leaves the server alone if it's not running" do
|
77
77
|
app = Proc.new {}
|
78
78
|
teardown = Teardown.new(app, nil)
|
79
|
-
env =
|
79
|
+
env = fake_environment
|
80
80
|
|
81
81
|
teardown.call(env)
|
82
82
|
|
@@ -91,8 +91,8 @@ module Landrush
|
|
91
91
|
app = Proc.new {}
|
92
92
|
teardown = Teardown.new(app, nil)
|
93
93
|
|
94
|
-
env =
|
95
|
-
env[:
|
94
|
+
env = fake_environment
|
95
|
+
env[:machine].config.landrush.disable
|
96
96
|
|
97
97
|
teardown.call(env)
|
98
98
|
|
@@ -17,7 +17,10 @@ module Landrush
|
|
17
17
|
Server.running?.must_equal false
|
18
18
|
end
|
19
19
|
|
20
|
+
# FIXME: This test requires network access.
|
21
|
+
# Which is not airplane hacking friendly. >:p
|
20
22
|
it 'can be queried for upstream entries' do
|
23
|
+
skip("needs network, and I am on an airplane without wifi")
|
21
24
|
Server.start
|
22
25
|
|
23
26
|
query("phinze.com").must_match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)
|
data/test/test_helper.rb
CHANGED
@@ -7,15 +7,8 @@ require 'landrush'
|
|
7
7
|
|
8
8
|
require 'minitest/autorun'
|
9
9
|
|
10
|
-
def fake_environment(
|
11
|
-
|
12
|
-
{ ui: FakeUI, global_config: env.config_global }.merge(extras)
|
13
|
-
end
|
14
|
-
|
15
|
-
def fake_environment_with_machine(hostname, ip)
|
16
|
-
env = Vagrant::Environment.new
|
17
|
-
machine = fake_machine(hostname, ip, env)
|
18
|
-
{ machine: machine, ui: FakeUI, global_config: env.config_global }
|
10
|
+
def fake_environment(options={})
|
11
|
+
{ machine: fake_machine(options), ui: FakeUI }
|
19
12
|
end
|
20
13
|
|
21
14
|
class RecordingCommunicator
|
@@ -54,41 +47,55 @@ class RecordingCommunicator
|
|
54
47
|
end
|
55
48
|
|
56
49
|
class Landrush::FakeProvider
|
57
|
-
def initialize(
|
50
|
+
def initialize(*args)
|
51
|
+
end
|
52
|
+
|
53
|
+
def _initialize(*args)
|
58
54
|
end
|
59
55
|
|
60
56
|
def ssh_info
|
61
57
|
end
|
62
58
|
end
|
63
59
|
|
64
|
-
|
60
|
+
class Landrush::FakeConfig
|
61
|
+
def landrush
|
62
|
+
@landrush_config ||= Landrush::Config.new
|
63
|
+
end
|
64
|
+
|
65
|
+
def vm
|
66
|
+
VagrantPlugins::Kernel_V2::VMConfig.new
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def fake_machine(options={})
|
71
|
+
env = options.fetch(:env, Vagrant::Environment.new)
|
65
72
|
machine = Vagrant::Machine.new(
|
66
73
|
'fake_machine',
|
67
74
|
'fake_provider',
|
68
75
|
Landrush::FakeProvider,
|
69
76
|
'provider_config',
|
70
77
|
{}, # provider_options
|
71
|
-
env.
|
78
|
+
env.vagrantfile.config, # config
|
72
79
|
Pathname('data_dir'),
|
73
80
|
'box',
|
74
|
-
env
|
81
|
+
options.fetch(:env, Vagrant::Environment.new),
|
82
|
+
env.vagrantfile
|
75
83
|
)
|
76
84
|
|
77
85
|
machine.instance_variable_set("@communicator", RecordingCommunicator.new)
|
78
86
|
machine.communicate.stub_command(
|
79
87
|
"ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'",
|
80
|
-
"#{ip}\n"
|
88
|
+
"#{options.fetch(:ip, '1.2.3.4')}\n"
|
81
89
|
)
|
82
90
|
|
83
91
|
machine.config.landrush.enable
|
84
|
-
machine.config.vm.hostname = hostname
|
85
|
-
|
92
|
+
machine.config.vm.hostname = options.fetch(:hostname, 'somehost.vagrant.dev')
|
86
93
|
|
87
94
|
machine
|
88
95
|
end
|
89
96
|
|
90
97
|
def fake_static_entry(env, hostname, ip)
|
91
|
-
env[:
|
98
|
+
env[:machine].config.landrush.host(hostname, ip)
|
92
99
|
Landrush::Store.hosts.set(hostname, ip)
|
93
100
|
end
|
94
101
|
|
metadata
CHANGED
@@ -1,88 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: landrush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.11.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Paul Hinze
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-03-21 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rubydns
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '='
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 0.7.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '='
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
30
|
-
|
31
|
-
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '1.3'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '1.3'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rake
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
description: ! 'Even a Vagrant needs a place to settle down once in a while.
|
63
|
-
|
26
|
+
version: 0.7.0
|
27
|
+
description: |
|
28
|
+
Forget about IPs in Vagrant - Automated DNS for your VMs
|
64
29
|
|
65
30
|
This Vagrant plugin spins up a lightweight DNS server and makes it visible
|
66
|
-
|
67
31
|
to your guests and your host, so that you can easily access all your
|
68
|
-
|
69
32
|
machines without having to fiddle with IP addresses.
|
70
33
|
|
71
|
-
|
72
34
|
DNS records are automatically added and removed as machines are brought up
|
73
|
-
|
74
35
|
and down, and you can configure static entries to be returned from the
|
75
|
-
|
76
36
|
server as well. See the README for more documentation.
|
77
|
-
|
78
|
-
'
|
79
37
|
email:
|
80
38
|
- paul.t.hinze@gmail.com
|
81
39
|
executables: []
|
82
40
|
extensions: []
|
83
41
|
extra_rdoc_files: []
|
84
42
|
files:
|
85
|
-
- .gitignore
|
43
|
+
- ".gitignore"
|
86
44
|
- Gemfile
|
87
45
|
- LICENSE.txt
|
88
46
|
- README.md
|
@@ -94,6 +52,7 @@ files:
|
|
94
52
|
- doc/vagrant_dns_without_landrush.diag
|
95
53
|
- doc/vagrant_dns_without_landrush.svg
|
96
54
|
- examples/Vagrantfile
|
55
|
+
- issues/vbox/Vagrantfile
|
97
56
|
- landrush.gemspec
|
98
57
|
- lib/ext/rexec.rb
|
99
58
|
- lib/landrush.rb
|
@@ -133,27 +92,26 @@ files:
|
|
133
92
|
homepage: https://github.com/phinze/landrush
|
134
93
|
licenses:
|
135
94
|
- MIT
|
95
|
+
metadata: {}
|
136
96
|
post_install_message:
|
137
97
|
rdoc_options: []
|
138
98
|
require_paths:
|
139
99
|
- lib
|
140
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
-
none: false
|
142
101
|
requirements:
|
143
|
-
- -
|
102
|
+
- - ">="
|
144
103
|
- !ruby/object:Gem::Version
|
145
104
|
version: '0'
|
146
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
|
-
none: false
|
148
106
|
requirements:
|
149
|
-
- -
|
107
|
+
- - ">="
|
150
108
|
- !ruby/object:Gem::Version
|
151
109
|
version: '0'
|
152
110
|
requirements: []
|
153
111
|
rubyforge_project:
|
154
|
-
rubygems_version:
|
112
|
+
rubygems_version: 2.2.2
|
155
113
|
signing_key:
|
156
|
-
specification_version:
|
114
|
+
specification_version: 4
|
157
115
|
summary: a vagrant plugin providing consistent DNS visible on host and guests
|
158
116
|
test_files:
|
159
117
|
- test/landrush/action/setup_test.rb
|
@@ -168,4 +126,3 @@ test_files:
|
|
168
126
|
- test/support/fake_working_dir.rb
|
169
127
|
- test/support/test_server_daemon.rb
|
170
128
|
- test/test_helper.rb
|
171
|
-
has_rdoc:
|