collect-agent 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +52 -0
- data/bin/collect-agent +5 -8
- data/collect-agent.gemspec +1 -1
- data/lib/helpers.rb +1 -1
- metadata +3 -2
data/Gemfile.lock
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
chef (11.4.2)
|
5
|
+
erubis
|
6
|
+
highline (>= 1.6.9)
|
7
|
+
json (>= 1.4.4, <= 1.7.7)
|
8
|
+
mixlib-authentication (>= 1.3.0)
|
9
|
+
mixlib-cli (~> 1.3.0)
|
10
|
+
mixlib-config (>= 1.1.2)
|
11
|
+
mixlib-log (>= 1.3.0)
|
12
|
+
mixlib-shellout
|
13
|
+
net-ssh (~> 2.6)
|
14
|
+
net-ssh-multi (~> 1.1.0)
|
15
|
+
ohai (>= 0.6.0)
|
16
|
+
rest-client (>= 1.0.4, < 1.7.0)
|
17
|
+
yajl-ruby (~> 1.1)
|
18
|
+
erubis (2.7.0)
|
19
|
+
highline (1.6.18)
|
20
|
+
ipaddress (0.8.0)
|
21
|
+
json (1.7.7)
|
22
|
+
mime-types (1.23)
|
23
|
+
mixlib-authentication (1.3.0)
|
24
|
+
mixlib-log
|
25
|
+
mixlib-cli (1.3.0)
|
26
|
+
mixlib-config (1.1.2)
|
27
|
+
mixlib-log (1.6.0)
|
28
|
+
mixlib-shellout (1.1.0)
|
29
|
+
net-ssh (2.6.7)
|
30
|
+
net-ssh-gateway (1.2.0)
|
31
|
+
net-ssh (>= 2.6.5)
|
32
|
+
net-ssh-multi (1.1)
|
33
|
+
net-ssh (>= 2.1.4)
|
34
|
+
net-ssh-gateway (>= 0.99.0)
|
35
|
+
ohai (6.16.0)
|
36
|
+
ipaddress
|
37
|
+
mixlib-cli
|
38
|
+
mixlib-config
|
39
|
+
mixlib-log
|
40
|
+
mixlib-shellout
|
41
|
+
systemu
|
42
|
+
yajl-ruby
|
43
|
+
rest-client (1.6.7)
|
44
|
+
mime-types (>= 1.16)
|
45
|
+
systemu (2.5.2)
|
46
|
+
yajl-ruby (1.1.0)
|
47
|
+
|
48
|
+
PLATFORMS
|
49
|
+
ruby
|
50
|
+
|
51
|
+
DEPENDENCIES
|
52
|
+
chef
|
data/bin/collect-agent
CHANGED
@@ -20,15 +20,12 @@ end
|
|
20
20
|
ohai = Ohai::System.new
|
21
21
|
ohai.all_plugins
|
22
22
|
ohai.seen_plugins
|
23
|
-
Chef::Config.from_file(
|
23
|
+
Chef::Config.from_file(opts[:config])
|
24
24
|
host = Chef::Config[:node_name] || ohai[:fqdn] || ohai[:hostname]
|
25
|
-
client = Chef::REST.new(
|
26
|
-
node = client.get_rest(
|
25
|
+
client = Chef::REST.new(Chef::Config[:chef_server_url], host, Chef::Config[:client_key])
|
26
|
+
node = client.get_rest("nodes/#{host}")
|
27
27
|
|
28
|
-
|
29
|
-
node_automatic.each do |key, value|
|
30
|
-
node_automatic[key] = ohai.data[key] if ohai.data[key]
|
31
|
-
end
|
28
|
+
node.automatic_attrs.keys.each { |key| node.automatic_attrs[key] = ohai.data[key] if ohai.data[key] }
|
32
29
|
|
33
30
|
set_network_addresses(node)
|
34
|
-
client.put_rest(
|
31
|
+
client.put_rest("nodes/#{host}", node)
|
data/collect-agent.gemspec
CHANGED
data/lib/helpers.rb
CHANGED
@@ -5,7 +5,7 @@ def set_network_addresses(node)
|
|
5
5
|
private_addresses = Array.new
|
6
6
|
node.network['interfaces'].each do |iface, addrs|
|
7
7
|
addrs['addresses'].each do |ip, params|
|
8
|
-
all_addresses << ip if params['family'].eql?('inet') && !ip.match(localhost_regexp)
|
8
|
+
all_addresses << ip if params['family'].eql?('inet') && !ip.match(localhost_regexp) && !iface.match(/^lo/)
|
9
9
|
private_addresses << ip if params['family'].eql?('inet') && ip.match(private_regexp)
|
10
10
|
end
|
11
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: collect-agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -53,6 +53,7 @@ extra_rdoc_files: []
|
|
53
53
|
files:
|
54
54
|
- .gitignore
|
55
55
|
- Gemfile
|
56
|
+
- Gemfile.lock
|
56
57
|
- Rakefile
|
57
58
|
- bin/collect-agent
|
58
59
|
- collect-agent.gemspec
|