vagrant-ohai 0.1.4 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +3 -0
- data/lib/ohai/vagrant.rb +4 -2
- data/lib/vagrant-ohai/action_install_ohai_plugin.rb +1 -0
- data/lib/vagrant-ohai/config.rb +11 -0
- data/lib/vagrant-ohai/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjdmMDhkNjEwYmU2Yzg5ODM5ZGEzYWI1Y2Y2NDM5ZWM3ZDkzNWEzOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmUwNDIwN2EwNDQ5ZDJjZWVmYmI3MDdmNTE3OGU2YzEwYWVlOWNlYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzYxZjU0ZGFlMjdiMGUxNGUzZTE3MGIxOGRiYWRkNDMxM2E1NjMzMzk1YmE4
|
10
|
+
ZWE1NTA1MGQ4NGFlY2UxNmE2NDQwZDNjOTcwZWI0YThhZDNlMTI4YTIzYzEx
|
11
|
+
ZDU3NmY3YTBmNTVkYzE5MDAyNmQ2OGJhOGYwNzg5NDNiYjUyNDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDZjYTFkYTVlZDlmZDFhY2I0OTlkZTRkYTQ1OWM1YmMyZDgxYThjMWVjYmE1
|
14
|
+
OGZlYjg1NzVkZDEyYmM4OGQ2YjQxNGZiYjgxMDExOWJkMWYzZTAwM2I0YjA3
|
15
|
+
MTIyNzdmYzFiZjZjOGNmNzJlZjRkOWUzZmE1Mjc3M2M2YTU4NmI=
|
data/README.md
CHANGED
@@ -11,6 +11,9 @@ In particular, the ipaddress is set to the private network defined in vagrant, i
|
|
11
11
|
## Usage
|
12
12
|
|
13
13
|
The plugin will automatcially activate when using the `:chef_solo` or `:chef_client` provisioners. If you want to disable it, put `config.ohai.enable = false` in your Vagrantfile.
|
14
|
+
If you wish to use a primary nic which is not a private network, e.g. when using a bridge, set the `primary_nic` option:
|
15
|
+
|
16
|
+
config.ohai.primary_nic = "eth1"
|
14
17
|
|
15
18
|
## Compatability
|
16
19
|
|
data/lib/ohai/vagrant.rb
CHANGED
@@ -3,13 +3,15 @@ hints = hint?("vagrant")
|
|
3
3
|
provides "vagrant"
|
4
4
|
provides "cloud"
|
5
5
|
|
6
|
-
vagrant Mash.new
|
6
|
+
vagrant Mash.new
|
7
7
|
cloud Mash.new
|
8
8
|
|
9
9
|
if hints
|
10
10
|
vagrant.merge!(hints)
|
11
11
|
require_plugin "cloud"
|
12
|
-
if vagrant
|
12
|
+
if vagrant[:primary_nic]
|
13
|
+
ipaddress network[:interfaces][vagrant[:primary_nic]][:addresses].find{|addr, addr_opts| addr_opts[:family] == "inet"}.first
|
14
|
+
elsif vagrant[:private_ipv4]
|
13
15
|
cloud[:local_ipv4] = vagrant[:private_ipv4]
|
14
16
|
ipaddress vagrant[:private_ipv4]
|
15
17
|
end
|
data/lib/vagrant-ohai/config.rb
CHANGED
@@ -2,15 +2,26 @@ module VagrantPlugins
|
|
2
2
|
module Ohai
|
3
3
|
class Config < Vagrant.plugin(2, :config)
|
4
4
|
attr_accessor :enable
|
5
|
+
attr_accessor :primary_nic
|
5
6
|
|
6
7
|
def initialize
|
7
8
|
@enable = UNSET_VALUE
|
9
|
+
@primary_nic = UNSET_VALUE
|
8
10
|
end
|
9
11
|
def finalize!
|
10
12
|
@enable = true if @enable == UNSET_VALUE
|
13
|
+
@primary_nic = nil if @primary_nic == UNSET_VALUE
|
11
14
|
end
|
12
15
|
|
13
16
|
def validate(machine)
|
17
|
+
case @primary_nic
|
18
|
+
when /eth[0-9]+/
|
19
|
+
{}
|
20
|
+
when nil
|
21
|
+
{}
|
22
|
+
else
|
23
|
+
{"primary_nic" => ["primary_nic must match eth[0-9]+"]}
|
24
|
+
end
|
14
25
|
case @enable
|
15
26
|
when TrueClass, FalseClass
|
16
27
|
{}
|
data/lib/vagrant-ohai/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-ohai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Avishai Ish-Shalom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|