mccloud 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mccloud/provider/aws/provider.rb +13 -0
- data/lib/mccloud/provider/core/provider.rb +10 -0
- data/lib/mccloud/provisioner/chef_solo.rb +27 -2
- data/lib/mccloud/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c6517d800261185b44916b4ce87b82e1473edfb
|
4
|
+
data.tar.gz: 19f142b6ab99c7d7f3642b02d190f312b9ac4ca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c148c5ddbf827c515165422ae3118d44cc9cdd515c9b266c9218a3ff16d12b0043e54ac9c0c9f9f3aab1faccd430bbc1c4b39f867ff02c491289b997c3026066
|
7
|
+
data.tar.gz: e1051308a49abbd9d453face8751746523f980f9d7998a948f1687dbbc37a20810639e5a9b76ab8501ae043e9d98ecc305678e3934469fa2da10ad62b5db8e2e
|
@@ -213,6 +213,19 @@ module Mccloud
|
|
213
213
|
|
214
214
|
end
|
215
215
|
|
216
|
+
def hosts
|
217
|
+
hostentries = Hash.new
|
218
|
+
filter = self.filter
|
219
|
+
|
220
|
+
self.raw.servers.each do |s|
|
221
|
+
name = s.tags["Name"].sub(/^#{filter}/,'')
|
222
|
+
hostentries = Hash.new
|
223
|
+
hostentries[name]=s.public_ip_address
|
224
|
+
hostentries[name]=s.private_ip_address
|
225
|
+
end
|
226
|
+
return hostentries
|
227
|
+
end
|
228
|
+
|
216
229
|
end
|
217
230
|
end
|
218
231
|
end
|
@@ -67,6 +67,16 @@ module Mccloud
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
def hosts
|
71
|
+
hostentries = Hash.new
|
72
|
+
self.vms.each do |name,vm|
|
73
|
+
hostentries[name] = Hash.new
|
74
|
+
hostentries[name]['public_ip_address'] = vm.public_ip_address
|
75
|
+
hostentries[name]['private_ip_address'] = vm.private_ip_address
|
76
|
+
end
|
77
|
+
return hostentries
|
78
|
+
end
|
79
|
+
|
70
80
|
#TODO this loading of gem , needs to be moved else where
|
71
81
|
#This provider should only check what it needs
|
72
82
|
|
@@ -57,10 +57,35 @@ module Mccloud
|
|
57
57
|
|
58
58
|
public_ips=Hash.new
|
59
59
|
private_ips=Hash.new
|
60
|
+
|
61
|
+
providers = Hash.new
|
62
|
+
# Add all providers
|
60
63
|
server.provider.vms.each do |name,vm|
|
61
|
-
|
62
|
-
|
64
|
+
providers[vm.provider.name] = vm.provider if providers[vm.provider.name].nil?
|
65
|
+
end
|
66
|
+
|
67
|
+
providers.each do |providername,provider|
|
68
|
+
hosts = providers[providername].hosts
|
69
|
+
hosts.each do |name,host|
|
70
|
+
public_ips[name]=host['public_ip_address']
|
71
|
+
private_ips[name]=host['private_ip_address']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
=begin
|
76
|
+
|
77
|
+
# For each provider , get the ip-addresses
|
78
|
+
providers.each do |providername, provider|
|
79
|
+
#namespace = provider.namespace
|
80
|
+
filter = provider.filter
|
81
|
+
|
82
|
+
provider.raw.servers.each do |s|
|
83
|
+
name = s.tags["Name"].sub(/^#{filter}/,'')
|
84
|
+
public_ips[name]=s.public_ip_address
|
85
|
+
private_ips[name]=s.private_ip_address
|
86
|
+
end
|
63
87
|
end
|
88
|
+
=end
|
64
89
|
|
65
90
|
# http://www.techques.com/question/1-3242470/Problem-using-OpenStruct-with-ERB
|
66
91
|
# We only want specific variables for ERB
|
data/lib/mccloud/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mccloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Debois
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|