knife-rackspace-load-balancer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,21 +12,35 @@ class Chef
12
12
 
13
13
  def resolve_node_ips_from_config(options)
14
14
  node_ips = []
15
+
15
16
  if options[:by_search]
16
17
  nodes_from_chef = nodes_by_search(options[:by_search])
18
+ node_ips = find_internal_ip_from_node(nodes_from_chef)
17
19
 
18
- node_ips = nodes_from_chef.map {|n| n.rackspace.private_ip}
19
20
  elsif options[:by_name]
20
21
  node_names = options[:by_name].split(",")
21
- nodes_from_chef = nodes_by_search(node_names.map {|n| "name:#{n}"}.join(" OR "))
22
+ nodes_from_chef = nodes_by_search(
23
+ node_names.map {|n| "name:#{n}"}.join(" OR ")
24
+ )
25
+
26
+ node_ips = find_internal_ip_from_node(nodes_from_chef)
22
27
 
23
- node_ips = nodes_from_chef.map {|n| n.rackspace.private_ip}
24
28
  elsif options[:by_private_ip]
25
29
  node_ips = config[:by_private_ip].split(",")
26
30
  end
27
31
 
28
32
  node_ips
29
33
  end
34
+
35
+ private
36
+
37
+ def find_internal_ip_from_node(nodes)
38
+ nodes.map do |node|
39
+ node.network["interfaces"]["eth1"]["addresses"].keys.detect do |ip|
40
+ ip =~ /10\./
41
+ end
42
+ end
43
+ end
30
44
  end
31
45
  end
32
46
  end
data/lib/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Knife
2
2
  module Rackspace
3
3
  module LoadBalancer
4
- VERSION="0.0.1"
4
+ VERSION="0.0.2"
5
5
  MAJOR, MINOR, TINY = VERSION.split(".")
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,60 +1,70 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: knife-rackspace-load-balancer
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
4
5
  prerelease:
5
- version: 0.0.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Matthew Vermaak
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-04-12 00:00:00 -04:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2012-04-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: chef
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
18
+ requirements:
22
19
  - - ~>
23
- - !ruby/object:Gem::Version
20
+ - !ruby/object:Gem::Version
24
21
  version: 0.10.8
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: knife-rackspace
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.10.8
30
+ - !ruby/object:Gem::Dependency
31
+ name: knife-rackspace
32
+ requirement: !ruby/object:Gem::Requirement
31
33
  none: false
32
- requirements:
34
+ requirements:
33
35
  - - ~>
34
- - !ruby/object:Gem::Version
36
+ - !ruby/object:Gem::Version
35
37
  version: 0.5.12
36
38
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: cloudlb
40
39
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
42
41
  none: false
43
- requirements:
42
+ requirements:
44
43
  - - ~>
45
- - !ruby/object:Gem::Version
44
+ - !ruby/object:Gem::Version
45
+ version: 0.5.12
46
+ - !ruby/object:Gem::Dependency
47
+ name: cloudlb
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
46
53
  version: 0.1.0
47
54
  type: :runtime
48
- version_requirements: *id003
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.1.0
49
62
  description: A gem to extend knife-rackspace allowing cloud load balancer management.
50
63
  email: dev@howaboutwe.com
51
64
  executables: []
52
-
53
65
  extensions: []
54
-
55
66
  extra_rdoc_files: []
56
-
57
- files:
67
+ files:
58
68
  - .gitignore
59
69
  - LICENSE.txt
60
70
  - README.rdoc
@@ -68,33 +78,29 @@ files:
68
78
  - lib/chef/knife/rackspace_load_balancer_nodes.rb
69
79
  - lib/chef/knife/rackspace_load_balancer_show.rb
70
80
  - lib/version.rb
71
- has_rdoc: true
72
81
  homepage: http://github.com/howaboutwe/knife-rackspace-load-balancer
73
- licenses:
82
+ licenses:
74
83
  - MIT
75
84
  post_install_message:
76
85
  rdoc_options: []
77
-
78
- require_paths:
86
+ require_paths:
79
87
  - lib
80
- required_ruby_version: !ruby/object:Gem::Requirement
88
+ required_ruby_version: !ruby/object:Gem::Requirement
81
89
  none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- version: "0"
86
- required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
95
  none: false
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: "0"
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
92
100
  requirements: []
93
-
94
101
  rubyforge_project:
95
- rubygems_version: 1.6.2
102
+ rubygems_version: 1.8.21
96
103
  signing_key:
97
104
  specification_version: 3
98
105
  summary: Rackspace cloud load balancer support for knife
99
106
  test_files: []
100
-