chef-metal 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/chef_metal/convergence_strategy/precreate_chef_objects.rb +1 -5
- data/lib/chef_metal/machine/basic_machine.rb +2 -2
- data/lib/chef_metal/machine.rb +4 -4
- data/lib/chef_metal/transport/ssh.rb +11 -4
- data/lib/chef_metal/transport.rb +2 -3
- data/lib/chef_metal/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: f78844f0b35265a0587a59130f2cc18f094c91ee
|
4
|
+
data.tar.gz: 4456458de1b2708269d784c6dd1c42559353b861
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbec23e421ace3000e3f09dca9142120683fbd5201d4187adf73f8381b36a1d4863a803a716e8bc77e69b0ce69b1d6c17980ea8fbdc355d37534d7a452a6de62
|
7
|
+
data.tar.gz: 3652afb4356159e48a3103c6fe1e9f6477219074453cd9fd11f164dce9c44f717f80c75e23d2d78f7202d7151c9f110e731d7e9aea109b816f64da67a0e38b0a
|
data/CHANGELOG.md
CHANGED
@@ -22,11 +22,7 @@ module ChefMetal
|
|
22
22
|
|
23
23
|
# If the chef server lives on localhost, tunnel the port through to the guest
|
24
24
|
chef_server_url = machine_resource.chef_server[:chef_server_url]
|
25
|
-
|
26
|
-
# TODO IPv6
|
27
|
-
if is_localhost(url.host)
|
28
|
-
machine.forward_remote_port_to_local(url.port, url.port)
|
29
|
-
end
|
25
|
+
chef_server_url = machine.make_url_available_to_remote(chef_server_url)
|
30
26
|
|
31
27
|
# Create client.rb and client.pem on machine
|
32
28
|
content = client_rb_content(chef_server_url, machine.node['name'])
|
@@ -67,8 +67,8 @@ module ChefMetal
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
def
|
71
|
-
transport.
|
70
|
+
def make_url_available_to_remote(local_url)
|
71
|
+
transport.make_url_available_to_remote(local_url)
|
72
72
|
end
|
73
73
|
|
74
74
|
def disconnect
|
data/lib/chef_metal/machine.rb
CHANGED
@@ -17,7 +17,6 @@ module ChefMetal
|
|
17
17
|
raise "converge not overridden on #{self.class}"
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
20
|
def execute(action_handler, command)
|
22
21
|
raise "execute not overridden on #{self.class}"
|
23
22
|
end
|
@@ -67,9 +66,10 @@ module ChefMetal
|
|
67
66
|
raise "get_attributes not overridden on #{self.class}"
|
68
67
|
end
|
69
68
|
|
70
|
-
#
|
71
|
-
|
72
|
-
|
69
|
+
# Ensure the given URL can be reached by the remote side (possibly by port forwarding)
|
70
|
+
# Must return the URL that the remote side can use to reach the local_url
|
71
|
+
def make_url_available_to_remote(local_url)
|
72
|
+
raise "make_url_available_to_remote not overridden on #{self.class}"
|
73
73
|
end
|
74
74
|
|
75
75
|
def disconnect
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'chef_metal/transport'
|
2
|
+
require 'uri'
|
3
|
+
require 'socket'
|
2
4
|
|
3
5
|
module ChefMetal
|
4
6
|
class Transport
|
@@ -94,10 +96,15 @@ module ChefMetal
|
|
94
96
|
end
|
95
97
|
end
|
96
98
|
|
97
|
-
def
|
98
|
-
|
99
|
-
|
100
|
-
|
99
|
+
def make_url_available_to_remote(local_url)
|
100
|
+
uri = URI(local_url)
|
101
|
+
host = Socket.getaddrinfo(uri.host, uri.scheme, nil, :STREAM)[0][3]
|
102
|
+
if host == '127.0.0.1' || host == '[::1]'
|
103
|
+
# TODO IPv6
|
104
|
+
Chef::Log.debug("Forwarding local server 127.0.0.1:#{uri.port} to port #{uri.port} on #{username}@#{host}")
|
105
|
+
session.forward.remote(uri.port, "127.0.0.1", uri.port)
|
106
|
+
end
|
107
|
+
local_url
|
101
108
|
end
|
102
109
|
|
103
110
|
def disconnect
|
data/lib/chef_metal/transport.rb
CHANGED
@@ -20,9 +20,8 @@ module ChefMetal
|
|
20
20
|
write_file(path, IO.read(local_path))
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
raise "forward_remote_port_to_local not overridden on #{self.class}"
|
23
|
+
def make_url_available_to_remote(local_url)
|
24
|
+
raise "make_url_available_to_remote not overridden on #{self.class}"
|
26
25
|
end
|
27
26
|
|
28
27
|
def disconnect
|
data/lib/chef_metal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-metal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Keiser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|