vagrant-adbinfo 0.0.9 → 0.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69ba917d086339736dfd37c2dfcd19f99203119b
4
- data.tar.gz: f18817b21274c028ea9cd345ccb192bb116d8e09
3
+ metadata.gz: 8b94c04f399859bdfca7a809a8d5fe7365bab9b0
4
+ data.tar.gz: c5a70ebb551a1b9f1b8c1c1866a2a55954fce047
5
5
  SHA512:
6
- metadata.gz: 2ffe2d7f944214ec39cb59c89ddd2053b4b25137c3b1dd8de8c39f1ad8a57373d0a9ae83941afc6249070cb59e613911b969973137c3356af71957a87057c8a0
7
- data.tar.gz: 249e2cf2a6ddda3bf103505136fe8591fff78dabed32f6da4d8a7833bcf64b1317fbb0360b86b31d994b7b62a57c36d87ae9e7ac2c43f5990d9c950331032c49
6
+ metadata.gz: 57cdb3e98b1d3551f40f58353e4b57fc903b7222b98cc6f431fd76dfe439aa4d7eb99ee6bba4b92fdca5434e550f4395866e3c9cbbb39bb17d4088486100eaa5
7
+ data.tar.gz: e01ba9c34b8ee99cd33f63789035c976db741871bbe002e58555bc4561a1dd39b724e99f4fbd53ad67d8269b3f8d6165b685903342ac85f8f39f58159d0db0eb
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ ## v0.1.0 Jan 19, 2015
4
+
5
+ - Fix#66: Added CHANGELOG.md to repository
6
+ - Added gemspec in Gemfile to enable bundler packaging
7
+ - Fix#67: OS is not a module (TypeError) on Windows
8
+ - Update ADB box Atlas namespace to projectatomic/adb
9
+ - Update README to reflect latest code and project goals
10
+ - Update Vagrantfile for QuickStart guide
11
+
12
+
13
+ ## v0.0.9 Nov 25, 2015
14
+
15
+ - Fix: Prevents TLS certs generation on every run of plugin
16
+
17
+
18
+ ## v0.0.8 Nov 24, 2015
19
+
20
+ - Fix#40: Handle private networking for different providers and generate Docker daemon TLS certs accordingly
21
+ - Support backward compatibility with older versions of ADB boxes
22
+ - lib/command.rb - Fixes bash file check command
23
+ - Restart Docker daemon after generating correct TLS certs
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gemspec
4
+
3
5
  group :development do
4
6
  gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
5
7
  # added as the vagrant component wouldn't build without it
data/README.md CHANGED
@@ -1,105 +1,49 @@
1
- Display docker information from a vagrant machine, similar to what boot2docker provides
1
+ # vagrant-adbinfo Vagrant Plugin
2
2
 
3
- Based in part on the work done by Michael Kuzmin for vagrant-guestip at https://github.com/mkuzmin/vagrant-guestip
3
+ Provide setup information, including environment variables and certificates, required to access services provided by an [Atomic Developer Bundle (ADB)](https://github.com/projectatomic/adb-atomic-developer-bundle). This plugin makes it easier to use the ADB with host-based tools such as Eclipse and the docker and kubernetes CLI commands. Details on this usage pattern can be found in the [ADB Documentation](https://github.com/projectatomic/adb-atomic-developer-bundle/blob/master/docs/using.rst).
4
4
 
5
- #Quick Start
5
+ The [Atomic Developer Bundle](https://github.com/projectatomic/adb-atomic-developer-bundle) is Vagrant box that provides a ready-to-use development environment for container applications. With ADB, developers can dive right into producing complex, multi-container applications.
6
6
 
7
- - Export following in a `Vagranfile`
7
+ ## Quick Start
8
8
 
9
- ```ruby
10
- # -*- mode: ruby -*-
11
- # vi: set ft=ruby :
9
+ 1. Install and start the Atomic Developer Bundle (ADB), as [documented](https://github.com/projectatomic/adb-atomic-developer-bundle/blob/master/docs/installing.rst) in the ADB project.
12
10
 
13
- #Vagrant file for libvirt/kvm and virtualbox provider
11
+ 2. Install the vagrant-adbinfo plugin
14
12
 
15
- # check if plugin is installed on system
16
- unless Vagrant.has_plugin?("vagrant-adbinfo")
17
- raise "vagrant-adbinfo plugin is not installed, run `vagrant plugin install vagrant-adbinfo` to install the plugin."
18
- end
13
+ vagrant plugin install vagrant-adbinfo
19
14
 
20
- Vagrant.configure(2) do |config|
21
- config.vm.box = "atomicapp/dev"
15
+ 3. Run the plugin to get environment variables and certificates
22
16
 
23
- # forward the guest port 2376 of `docker` daemon in guest to host port 2379 for client side tooling to connect
24
- config.vm.network "forwarded_port", guest: 2376, host: 2379, auto_correct: true
17
+ $ vagrant adbinfo
18
+ Set the following environment variables to enable access to the
19
+ docker daemon running inside of the vagrant virtual machine:
25
20
 
26
- config.vm.provider "libvirt" do |libvirt, override|
27
- libvirt.driver = "kvm"
28
- libvirt.memory = 1024
29
- libvirt.cpus = 2
30
- end
21
+ export DOCKER_HOST=tcp://172.13.14.1:5555
22
+ export DOCKER_CERT_PATH=/home/bexelbie/Repositories/vagrant-adbinfo/.vagrant/machines/default/virtualbox/.docker
23
+ export DOCKER_TLS_VERIFY=1
24
+ export DOCKER_MACHINE_NAME="90d3e96"
31
25
 
32
- config.vm.provider "virtualbox" do |vbox, override|
33
- vbox.memory = 1024
34
- vbox.cpus = 2
26
+ 4. Begin using your host-based tools.
35
27
 
36
- # Enable use of more than one virtual CPU in a virtual machine.
37
- vbox.customize ["modifyvm", :id, "--ioapic", "on"]
38
- end
28
+ ## Get Involved/Contact Us
39
29
 
40
- end
41
- ```
30
+ * IRC: #atomic and #nulecule on freenode
31
+ * Mailing List: container-tools@redhat.com
42
32
 
43
- - ```vagrant up```
33
+ ## How to Develop/Test
44
34
 
45
- - ```vagrant adbinfo```
35
+ 1. Install the Atomic Developer Bundle (ADB), as [documented](https://github.com/projectatomic/adb-atomic-developer-bundle/blob/master/docs/installing.rst) in the ADB project. Do not start the box yet.
46
36
 
37
+ 2. Run `bundle install`
47
38
 
48
- #How to Develop/Test
39
+ 3. Start the box with `bundle exec vagrant up`
49
40
 
50
- 1 - Install VirtualBox (http://www.if-not-true-then-false.com/2010/install-virtualbox-with-yum-on-fedora-centos-red-hat-rhel/)
41
+ 4. Develop. You can test the command by running `bundle exec vagrant adbinfo`
51
42
 
52
- 2 - Get a box to test
43
+ 5. When you are ready to build the release, get a maintainer to:
53
44
 
54
- 3 - Build a vagrant file
45
+ 1. Put the gemfile in pkg/ with `rake build`
55
46
 
56
- 4 - bundle install
47
+ 2. Increment the Version Number
57
48
 
58
- 5 - bundle exec vagrant up # starts the vagrant box
59
-
60
- 6 - bundle exec vagrant adbinfo # tests the command
61
-
62
- 7 - rake build # puts the gemfile in pkg/
63
-
64
- 8 - get bex to do a `rake release` after bumping the version number, etc.
65
-
66
-
67
- # Potential Plans/Ideas (in Priority Order)
68
-
69
- ## VirtualBox Support (Priority 1a - implemented)
70
-
71
- For the VirtualBox provider, the user is encouraged to use a forwarded_port directive (with auto_correct) in their Vagrantfile to expose the docker port.
72
-
73
- The plugin will use the :forwarded_ports capability to find the forwarded port number and provide it with localhost as the IP address.
74
-
75
- 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.
76
-
77
- ## TLS Certificate Location Support, part 2 (Priority 1b - implemented)
78
-
79
- The TLS certificate will always land in a known spot, so we need to add that
80
-
81
- ## libvirt Support (Priority 2 - not started)
82
-
83
- For the libvirt provider, the user will be encouraged to just start the box with no special directives in the Vagrantfile.
84
-
85
- The plugin will use the standard-docker port combined with the private IP address of the vagrant box.
86
-
87
- Why? vagrant-libvirt has two challenges:
88
-
89
- 1. There is currently no implementation of the :forwarded_ports capability to list all forwarded ports. Additionally the codebase does not keep track of these directly, so it is a non-trivial fix. (Though the fix may still be easy/medium).
90
- 2. Vagrant-libvirt doesn't actually support forwarded ports directly. Instead a private network is always started and when a forwarded port is requested and instance of `ssh` is spawned to take care of port forwarding. Since this has non-trivial overhead, there is no reason to use it when we can just get to the box directly
91
-
92
- ## Anti-Pattern Support (priority 3 - not started)
93
-
94
- - Support inbound network and no port forward for VirtualBox.
95
- - Support a port forward on libvirt.
96
- - note: port collision is not supported in libvirt, yet see:
97
- https://github.com/pradels/vagrant-libvirt/issues/321
98
-
99
- ## Other Ideas (not started)
100
-
101
- - Support `vagrant adbinfo <target>` (multiple targets?)
102
-
103
-
104
- ## Contact us
105
- For queries regarding the plugin, feel free to put a note on container-tools@redhat.com mailing list.
49
+ 3. Release the plugin with `rake release`
@@ -12,7 +12,7 @@ Vagrant.configure(2) do |config|
12
12
 
13
13
  # Every Vagrant development environment requires a box. You can search for
14
14
  # boxes at https://atlas.hashicorp.com/search.
15
- config.vm.box = "atomicapp/dev"
15
+ config.vm.box = "projectatomic/adb"
16
16
 
17
17
  # Disable automatic box update checking. If you disable this, then
18
18
  # boxes will only be checked for updates when the user runs
@@ -1,28 +1,9 @@
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
+ require_relative 'os'
21
2
  module VagrantPlugins
22
3
  module DockerInfo
23
4
  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>
5
+ # 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-adb-vagrant.ks>
6
+ # On Windows, pscp utility is used to copy the client side certs to the host, password is used in the pscp command because the ssh keys can not be used. Refer issue #14 for details
26
7
  @@vagrant_box_password = "vagrant"
27
8
 
28
9
  def self.synopsis
@@ -95,12 +76,10 @@ def print_info(guest_ip, port, secrets_path, machine_uuid)
95
76
  <<-eos
96
77
  # Set the following environment variables to enable access to the
97
78
  # docker daemon running inside of the vagrant virtual machine:
98
-
99
79
  export DOCKER_HOST=tcp://#{guest_ip}:#{port}
100
80
  export DOCKER_CERT_PATH=#{secrets_path}
101
81
  export DOCKER_TLS_VERIFY=1
102
82
  export DOCKER_MACHINE_NAME=#{machine_uuid[0..6]}
103
-
104
83
  # run following command to configure your shell:
105
84
  # eval "$(vagrant adbinfo)"
106
85
 
@@ -113,7 +92,6 @@ export DOCKER_MACHINE_NAME=#{machine_uuid[0..6]}
113
92
  <<-eos
114
93
  # Set the following environment variables to enable access to the
115
94
  # docker daemon running inside of the vagrant virtual machine:
116
-
117
95
  setx DOCKER_HOST tcp://#{guest_ip}:#{port}
118
96
  setx DOCKER_CERT_PATH #{secrets_path}
119
97
  setx DOCKER_TLS_VERIFY 1
@@ -0,0 +1,18 @@
1
+ # OS Module
2
+ module OS
3
+ def self.windows?
4
+ (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
5
+ end
6
+
7
+ def self.mac?
8
+ (/darwin/ =~ RUBY_PLATFORM) != nil
9
+ end
10
+
11
+ def self.unix?
12
+ !windows?
13
+ end
14
+
15
+ def self.linux?
16
+ unix? && !mac?
17
+ end
18
+ end
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'vagrant-adbinfo'
3
- spec.version = '0.0.9'
3
+ spec.version = '0.1.0'
4
4
  spec.homepage = 'https://github.com/bexelbie/vagrant-adbinfo'
5
- spec.summary = 'Vagrant plugin that provides the IP address:port and tls certificate file location for a docker daemon'
5
+ spec.summary = 'Vagrant plugin that provides the IP address:port and TLS certificate file location for a docker daemon'
6
6
 
7
7
  spec.authors = ['Brian Exelbierd', 'Navid Shaikh']
8
8
  spec.email = ['bex@pobox.com', 'nshaikh@redhat.com']
@@ -2,7 +2,7 @@
2
2
  %global vagrant_plugin_name vagrant-adbinfo
3
3
 
4
4
  Name: %{vagrant_plugin_name}
5
- Version: 0.0.9
5
+ Version: 0.1.0
6
6
  Release: 1%{?dist}
7
7
  Summary: Vagrant plugin that provides the IP address:port and TLS certificate file location for a Docker daemon
8
8
  Group: Development/Languages
@@ -82,8 +82,18 @@ popd
82
82
  %{vagrant_plugin_instdir}/MAINTAINERS
83
83
  %{vagrant_plugin_instdir}/vagrant-adbinfo.gemspec
84
84
  %{vagrant_plugin_instdir}/vagrant-adbinfo.spec
85
+ %{vagrant_plugin_instdir}/CHANGELOG.md
85
86
 
86
87
  %changelog
88
+ * Tue Jan 19 2016 Navid Shaikh - 0.1.0-1
89
+ - Bump version to 0.1.0
90
+ - Fix#66: Added CHANGELOG.md to repository
91
+ - Added gemspec in Gemfile to enable bundler packaging
92
+ - Fix#67: OS is not a module (TypeError) on Windows
93
+ - Update ADB box Atlas namespace to projectatomic/adb
94
+ - Update README to reflect latest code and project goals
95
+ - Update Vagrantfile for QuickStart guide
96
+
87
97
  * Wed Nov 25 2015 Brian Exelbierd - 0.0.9-1
88
98
  - Fixes cert-generation script existence check, a bug was found where the cert
89
99
  was regenerated to often
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.9
4
+ version: 0.1.0
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-11-25 00:00:00.000000000 Z
12
+ date: 2016-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -48,6 +48,7 @@ extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
50
  - ".gitignore"
51
+ - CHANGELOG.md
51
52
  - CONTRIBUTING.md
52
53
  - Gemfile
53
54
  - LICENSE
@@ -56,6 +57,7 @@ files:
56
57
  - Rakefile
57
58
  - Vagrantfile
58
59
  - lib/command.rb
60
+ - lib/os.rb
59
61
  - lib/vagrant-adbinfo.rb
60
62
  - vagrant-adbinfo.gemspec
61
63
  - vagrant-adbinfo.spec
@@ -81,6 +83,6 @@ rubyforge_project:
81
83
  rubygems_version: 2.4.8
82
84
  signing_key:
83
85
  specification_version: 4
84
- summary: Vagrant plugin that provides the IP address:port and tls certificate file
86
+ summary: Vagrant plugin that provides the IP address:port and TLS certificate file
85
87
  location for a docker daemon
86
88
  test_files: []