vagrant-adbinfo 0.0.3 → 0.0.4
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/README.md +3 -1
- data/lib/command.rb +46 -10
- data/vagrant-adbinfo.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 588d0db71d2a61c13683f51d90d2c518f5bd2063
|
4
|
+
data.tar.gz: 7860a8b536c595971661f7f5fe1c4c2ee832f1ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfd0a2c04047353a07da79861cef9b08df003fc04eb425aab74b86f05043d91a23fb6b90225c01ebb8bb9864d4b3d04a97d75dadb8e1ad3c325d0fd4a3883638
|
7
|
+
data.tar.gz: c5c6ccde72ae89c8308afa077de0218d7cf6ad195a90d8bf3ab31e4ca2dcf7aba488466df5f4e261c9156be7f9e968808b414b3f5dfa6a0920099194f6484902
|
data/README.md
CHANGED
@@ -31,7 +31,7 @@ The plugin will use the :forwarded_ports capability to find the forwarded port n
|
|
31
31
|
|
32
32
|
Why? By default Virtualbox creates a box that has no inbound network access. The pattern is to always forward ports, something that a daemon takes care.
|
33
33
|
|
34
|
-
## TLS Certificate Location Support, part 2 (Priority 1b -
|
34
|
+
## TLS Certificate Location Support, part 2 (Priority 1b - implemented)
|
35
35
|
|
36
36
|
The TLS certificate will always land in a known spot, so we need to add that
|
37
37
|
|
@@ -50,6 +50,8 @@ Why? vagrant-libvirt has two challenges:
|
|
50
50
|
|
51
51
|
- Support inbound network and no port forward for VirtualBox.
|
52
52
|
- Support a port forward on libvirt.
|
53
|
+
- note: port collision is not supported in libvirt, yet see:
|
54
|
+
https://github.com/pradels/vagrant-libvirt/issues/321
|
53
55
|
|
54
56
|
## Other Ideas (not started)
|
55
57
|
|
data/lib/command.rb
CHANGED
@@ -1,6 +1,29 @@
|
|
1
|
+
module OS
|
2
|
+
|
3
|
+
def OS.windows?
|
4
|
+
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
|
5
|
+
end
|
6
|
+
|
7
|
+
def OS.mac?
|
8
|
+
(/darwin/ =~ RUBY_PLATFORM) != nil
|
9
|
+
end
|
10
|
+
|
11
|
+
def OS.unix?
|
12
|
+
!OS.Windows?
|
13
|
+
end
|
14
|
+
|
15
|
+
def OS.linux?
|
16
|
+
OS.unix? and not OS.mac?
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
1
21
|
module VagrantPlugins
|
2
22
|
module DockerInfo
|
3
23
|
class Command < Vagrant.plugin(2, :command)
|
24
|
+
# Vagrant box password as defined in the Kickstart for the box <https://github.com/projectatomic/adb-atomic-developer-bundle/blob/master/build_tools/kickstarts/centos-7-kubernetes-vagrant.ks>
|
25
|
+
# On Windows, pscp utility is used to copy the client side certs on the host, this password is used in the pscp command because the ssh keys can not be used. Details: <https://github.com/bexelbie/vagrant-adbinfo/issues/14>
|
26
|
+
@@vagrant_box_password = "vagrant"
|
4
27
|
def self.synopsis
|
5
28
|
'provides the IP address:port and tls certificate file location for a docker daemon'
|
6
29
|
end
|
@@ -12,28 +35,41 @@ module VagrantPlugins
|
|
12
35
|
|
13
36
|
# First, get the TLS Certificates, if needed
|
14
37
|
if !File.directory?(File.expand_path(".docker", secrets_path)) then
|
15
|
-
|
16
|
-
|
38
|
+
# Find the ssh information
|
39
|
+
hIP = machine.ssh_info[:host]
|
40
|
+
hport = machine.ssh_info[:port]
|
41
|
+
husername = machine.ssh_info[:username]
|
17
42
|
|
43
|
+
if !OS.windows? then
|
44
|
+
hprivate_key_path = machine.ssh_info[:private_key_path][0]
|
18
45
|
# scp over the client side certs from guest to host machine
|
19
|
-
`scp -r -P #{hport} -o LogLevel=FATAL -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i #{
|
46
|
+
`scp -r -P #{hport} -o LogLevel=FATAL -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i #{hprivate_key_path} #{husername}@#{hIP}:/home/vagrant/.docker #{secrets_path}`
|
47
|
+
# extending the .docker path to include
|
48
|
+
secrets_path = File.expand_path(".docker", secrets_path)
|
49
|
+
else
|
50
|
+
`pscp -r -P #{hport} -pw #@@vagrant_box_password -p #{husername}@#{hIP}:/home/vagrant/.docker #{secrets_path}`
|
51
|
+
# extending the .docker path to include
|
52
|
+
secrets_path = File.expand_path(".docker", secrets_path)
|
53
|
+
secrets_path = secrets_path.split('/').join('\\') + '\\'
|
54
|
+
end
|
20
55
|
end
|
21
56
|
|
22
|
-
# Print configuration information for accesing the docker daemon
|
23
|
-
|
24
57
|
# Finds the host machine port forwarded from guest docker
|
25
58
|
port = machine.provider.capability(:forwarded_ports).key(2376)
|
26
|
-
|
59
|
+
guest_ip = "127.0.0.1"
|
60
|
+
|
61
|
+
# Print configuration information for accesing the docker daemon
|
62
|
+
message =
|
27
63
|
<<-eos
|
28
64
|
Set the following environment variables to enable access to the
|
29
65
|
docker daemon running inside of the vagrant virtual machine:
|
30
66
|
|
31
|
-
export DOCKER_HOST=tcp
|
32
|
-
export DOCKER_CERT_PATH=#{secrets_path}
|
67
|
+
export DOCKER_HOST=tcp://#{guest_ip}:#{port}
|
68
|
+
export DOCKER_CERT_PATH=#{secrets_path}
|
33
69
|
export DOCKER_TLS_VERIFY=1
|
34
|
-
export DOCKER_MACHINE_NAME
|
70
|
+
export DOCKER_MACHINE_NAME=#{machine.index_uuid[0..6]}
|
35
71
|
eos
|
36
|
-
@env.ui.info(message)
|
72
|
+
@env.ui.info(puts(message))
|
37
73
|
end
|
38
74
|
end
|
39
75
|
end
|
data/vagrant-adbinfo.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'vagrant-adbinfo'
|
3
|
-
spec.version = '0.0.
|
3
|
+
spec.version = '0.0.4'
|
4
4
|
spec.homepage = 'https://github.com/bexelbie/vagrant-adbinfo'
|
5
5
|
spec.summary = 'Vagrant plugin that provides the IP address:port and tls certificate file location for a docker daemon'
|
6
6
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-adbinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Exelbierd
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-09
|
12
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
76
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.
|
77
|
+
rubygems_version: 2.4.8
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: Vagrant plugin that provides the IP address:port and tls certificate file
|