vagrant-service-manager 0.0.1 → 0.0.2
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/CHANGELOG.md +29 -0
- data/MAINTAINERS +1 -0
- data/README.md +30 -5
- data/lib/vagrant-service-manager/command.rb +40 -12
- data/lib/vagrant-service-manager/version.rb +5 -0
- data/vagrant-service-manager.gemspec +4 -1
- data/vagrant-service-manager.spec +21 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4049a74d704cc4fdf31f1fe31b438c6d8f15b729
|
4
|
+
data.tar.gz: 1d12088ff7c0f5bf5a2dee49e7bce5cff1a1f539
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 989478ba129bdb743aa172c4e727b70f7b8b63bb4f7c5e138d352866a4509d5f12e64022db7c34f51b33e52ace299fa6c4739cebc850ed241ac9544d9ab18042
|
7
|
+
data.tar.gz: 97a038503acfe3140a3a95e67c266aa78cf1ab9c40d196c3843b36d265922d66274e58bb1b9552cdfac388c7c614799aa2075c7ca111eedd9ca535de65ffa614
|
data/CHANGELOG.md
CHANGED
@@ -1 +1,30 @@
|
|
1
1
|
# Changelog
|
2
|
+
|
3
|
+
## v0.0.2 Feb 17, 2016
|
4
|
+
- Fixes #53: Prep for version v0.0.2
|
5
|
+
- Fixes #41: Plugin reports to bring up machine for even help command @navidshaikh
|
6
|
+
- Updates CHANGELOG.md @navidshaikh
|
7
|
+
- Fix #41: Fixes the check for finding vagrant box state @navidshaikh
|
8
|
+
- Adding a version.rb @lalatendumohanty
|
9
|
+
- Adding steps to build the plugin using Bundler @lalatendumohanty
|
10
|
+
- Update README with quick start steps @navidshaikh
|
11
|
+
- Fixes #31: Private key wasn't being sourced for libvirt @bexelbie
|
12
|
+
- Add notice when copying certificates @bexelbie
|
13
|
+
- `vagrant service-manager env` return all info @bexelbie
|
14
|
+
- Fix #4 and #5: Add running machine detection @bexelbie
|
15
|
+
- Adding objective to the README @lalatendumohanty
|
16
|
+
- Adds links to gemfile and copr build @navidshaikh
|
17
|
+
- Adds SPEC file for version 0.0.1 release @navidshaikh
|
18
|
+
|
19
|
+
## v0.0.1 Feb 09, 2016
|
20
|
+
- Updates the source git repository URL
|
21
|
+
- Restructure the lib directory and sources plugin from module
|
22
|
+
- Removes unused vagrant password from repository
|
23
|
+
- Uses net/scp module instead of scp command
|
24
|
+
- Adds a sub-command for configuring docker daemon vagrant-service-manager env docker
|
25
|
+
- Ports equivalent functionality of plugin for https://github.com/projectatomic/vagrant-adbinfo
|
26
|
+
- Renames the plugin and update the rest of repository
|
27
|
+
|
28
|
+
@navidshaikh @bexelbie
|
29
|
+
|
30
|
+
## Plugin is forked and extended from [vagrant-adbinfo](https://github.com/projectatomic/vagrant-adbinfo)
|
data/MAINTAINERS
CHANGED
data/README.md
CHANGED
@@ -1,17 +1,23 @@
|
|
1
|
-
# vagrant-service-manager
|
1
|
+
# vagrant-service-manager
|
2
2
|
|
3
|
-
|
3
|
+
Provides 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
|
+
|
5
|
+
##Objective
|
6
|
+
|
7
|
+
* To provide the user a CLI to configure the [ADB](https://github.com/projectatomic/adb-atomic-developer-bundle) for different use cases and to provide glue between ADB and the user's development environment.
|
8
|
+
|
9
|
+
* Provide users a tool to control and configure the ADB from the developer's workstation without having to `ssh` into it.
|
4
10
|
|
5
11
|
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
12
|
|
7
13
|
## Quick Start
|
8
14
|
|
9
|
-
1. Install
|
10
|
-
|
11
|
-
2. Install the vagrant-service-manager plugin
|
15
|
+
1. Install `vagrant-service-manager` plugin
|
12
16
|
|
13
17
|
vagrant plugin install vagrant-service-manager
|
14
18
|
|
19
|
+
2. Get the [Vagrantfile](Vagrantfile) and start the ADB using `vagrant up`. [More](https://github.com/projectatomic/adb-atomic-developer-bundle/blob/master/docs/installing.rst) documentation on setting up ADB.
|
20
|
+
|
15
21
|
3. Run the plugin to get environment variables and certificates
|
16
22
|
|
17
23
|
$ vagrant service-manager env docker
|
@@ -51,3 +57,22 @@ The [Atomic Developer Bundle](https://github.com/projectatomic/adb-atomic-develo
|
|
51
57
|
4. Tag the release commit with a vX.Y.Z tag
|
52
58
|
|
53
59
|
5. Create a Github release
|
60
|
+
|
61
|
+
###How to build the Vagrant plugin using Bundler
|
62
|
+
|
63
|
+
You can also use Bundler to build the plugin and install it manually in your Vagrant environment
|
64
|
+
|
65
|
+
```
|
66
|
+
git clone this repository and run below commands inside the repository
|
67
|
+
|
68
|
+
1. bundle install
|
69
|
+
2. bundle exec rake build
|
70
|
+
|
71
|
+
You can install the plugin using `vagrant install pkg/<gem name>` command.
|
72
|
+
````
|
73
|
+
|
74
|
+
## Builds
|
75
|
+
|
76
|
+
- Gemfile: https://rubygems.org/gems/vagrant-service-manager
|
77
|
+
|
78
|
+
- copr build: https://copr.fedorainfracloud.org/coprs/nshaikh/vagrant-service-manager/builds/
|
@@ -11,13 +11,39 @@ module Vagrant
|
|
11
11
|
'provides the IP address:port and tls certificate file location for a docker daemon'
|
12
12
|
end
|
13
13
|
|
14
|
+
def exit_if_machine_not_running
|
15
|
+
# Exit from plugin with status 1 if machine is not running
|
16
|
+
with_target_vms(nil, {:single_target=>true}) do |machine|
|
17
|
+
if machine.state.id != :running then
|
18
|
+
message = <<-eos
|
19
|
+
The virtual machine must be running before you execute this command.
|
20
|
+
Try this in the directory with your Vagrantfile:
|
21
|
+
vagrant up
|
22
|
+
eos
|
23
|
+
@env.ui.info(message)
|
24
|
+
exit 1
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
14
29
|
def execute
|
15
30
|
plugin_name, command, subcommand = ARGV
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
31
|
+
case command
|
32
|
+
when "env"
|
33
|
+
self.exit_if_machine_not_running
|
34
|
+
case subcommand
|
35
|
+
when "docker"
|
36
|
+
self.execute_docker_info
|
37
|
+
when nil
|
38
|
+
self.execute_docker_info
|
39
|
+
else
|
40
|
+
self.print_help
|
41
|
+
end
|
42
|
+
when "help"
|
43
|
+
self.print_help
|
44
|
+
else
|
45
|
+
self.print_help
|
46
|
+
end
|
21
47
|
end
|
22
48
|
|
23
49
|
def print_help
|
@@ -54,7 +80,7 @@ $vagrant service-manager env docker
|
|
54
80
|
# this execute the operations needed to print the docker env info
|
55
81
|
with_target_vms(nil, {:single_target=>true}) do |machine|
|
56
82
|
# Path to the private_key and where we will store the TLS Certificates
|
57
|
-
secrets_path = machine.data_dir
|
83
|
+
secrets_path = File.expand_path("docker", machine.data_dir)
|
58
84
|
|
59
85
|
hIP = machine.ssh_info[:host]
|
60
86
|
hport = machine.ssh_info[:port]
|
@@ -79,18 +105,23 @@ $vagrant service-manager env docker
|
|
79
105
|
port = 2376
|
80
106
|
|
81
107
|
# First, get the TLS Certificates, if needed
|
82
|
-
if !File.directory?(
|
108
|
+
if !File.directory?(secrets_path) then
|
83
109
|
|
84
110
|
# Regenerate the certs and restart docker daemon in case of the new ADB box and for VirtualBox provider
|
85
111
|
if machine.provider_name == :virtualbox then
|
86
|
-
hprivate_key_path = machine.ssh_info[:private_key_path][0]
|
87
112
|
# `test` checks if the file exists, and then regenerates the certs and restart the docker daemon, else do nothing.
|
88
113
|
command2 = "test ! -f /opt/adb/cert-gen.sh || (sudo rm /etc/docker/ca.pem && sudo systemctl restart docker)"
|
89
114
|
machine.communicate.execute(command2)
|
90
115
|
end
|
91
116
|
|
117
|
+
# Get the private key
|
118
|
+
hprivate_key_path = machine.ssh_info[:private_key_path][0]
|
119
|
+
|
92
120
|
# copy the required client side certs from inside the box to host machine
|
93
|
-
|
121
|
+
@env.ui.info("# Copying TLS certificates to #{secrets_path}")
|
122
|
+
self.copy_from_box(hIP, hport, husername, hprivate_key_path, "/home/vagrant/.docker/ca.pem", "#{secrets_path}")
|
123
|
+
self.copy_from_box(hIP, hport, husername, hprivate_key_path, "/home/vagrant/.docker/cert.pem", "#{secrets_path}")
|
124
|
+
self.copy_from_box(hIP, hport, husername, hprivate_key_path, "/home/vagrant/.docker/key.pem", "#{secrets_path}")
|
94
125
|
end
|
95
126
|
|
96
127
|
# display the information, irrespective of the copy operation
|
@@ -101,9 +132,6 @@ $vagrant service-manager env docker
|
|
101
132
|
def print_info(guest_ip, port, secrets_path, machine_uuid)
|
102
133
|
# Print configuration information for accesing the docker daemon
|
103
134
|
|
104
|
-
# extending the .docker path to include
|
105
|
-
secrets_path = File.expand_path(".docker", secrets_path)
|
106
|
-
|
107
135
|
if !OS.windows? then
|
108
136
|
message =
|
109
137
|
<<-eos
|
@@ -1,6 +1,9 @@
|
|
1
|
+
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
|
2
|
+
require 'vagrant-service-manager/version'
|
3
|
+
|
1
4
|
Gem::Specification.new do |spec|
|
2
5
|
spec.name = 'vagrant-service-manager'
|
3
|
-
spec.version =
|
6
|
+
spec.version = Vagrant::ServiceManager::VERSION
|
4
7
|
spec.homepage = 'https://github.com/projectatomic/vagrant-service-manager'
|
5
8
|
spec.summary = "To provide the user a CLI to configure the ADB/CDK for different use cases and to provide glue between ADB/CDK and the user's developer environment."
|
6
9
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
%global vagrant_plugin_name vagrant-service-manager
|
3
3
|
|
4
4
|
Name: %{vagrant_plugin_name}
|
5
|
-
Version: 0.0.
|
5
|
+
Version: 0.0.2
|
6
6
|
Release: 1%{?dist}
|
7
7
|
Summary: To provide the user a CLI to configure the ADB/CDK for different use cases and to provide glue between ADB/CDK and the user's developer environment.
|
8
8
|
Group: Development/Languages
|
9
|
-
License: GPLv2
|
9
|
+
License: GPLv2
|
10
10
|
URL: https://github.com/bexelbie/vagrant-service-manager
|
11
11
|
Source0: https://rubygems.org/gems/%{vagrant_plugin_name}-%{version}.gem
|
12
12
|
Requires(posttrans): vagrant
|
@@ -14,7 +14,7 @@ Requires(preun): vagrant
|
|
14
14
|
Requires: vagrant
|
15
15
|
BuildRequires: ruby(release)
|
16
16
|
BuildRequires: rubygems-devel >= 1.3.6
|
17
|
-
BuildRequires: ruby
|
17
|
+
BuildRequires: ruby
|
18
18
|
BuildRequires: vagrant
|
19
19
|
BuildArch: noarch
|
20
20
|
Provides: vagrant(%{vagrant_plugin_name}) = %{version}
|
@@ -82,7 +82,24 @@ popd
|
|
82
82
|
%{vagrant_plugin_instdir}/vagrant-service-manager.gemspec
|
83
83
|
%{vagrant_plugin_instdir}/vagrant-service-manager.spec
|
84
84
|
%{vagrant_plugin_instdir}/CHANGELOG.md
|
85
|
+
%{vagrant_plugin_instdir}/TODO
|
85
86
|
|
86
87
|
%changelog
|
87
|
-
*
|
88
|
+
* Tue Feb 17 2016 Navid Shaikh - 0.0.2-1
|
89
|
+
- Bumps version to v0.0.2
|
90
|
+
- Fixed prompting for bringing machine up for help command
|
91
|
+
- Adds Lalatendu Mohanty as maintainer
|
92
|
+
- Fixed check for finding vagrant box state
|
93
|
+
- Adds version.rb to fetch the version of plugin
|
94
|
+
- Adds steps to build the plugin using bundler
|
95
|
+
- Updates README with quick start steps
|
96
|
+
- Fixed issue for private key not being sourced for libvirt provider
|
97
|
+
- Add notice when copying certificates
|
98
|
+
- `vagrant service-manager env` returns all info
|
99
|
+
- Adds running machine detection in plugin for better error reporting
|
100
|
+
- Updates README with objective
|
101
|
+
- Updates README with gemfile and copr builds
|
102
|
+
- Added SPEC file to the git repository of plugin
|
103
|
+
|
104
|
+
* Thu Feb 09 2016 Navid Shaikh - 0.0.1-1
|
88
105
|
- Initial build
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-service-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
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: 2016-02-
|
12
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- lib/vagrant-service-manager/command.rb
|
62
62
|
- lib/vagrant-service-manager/os.rb
|
63
63
|
- lib/vagrant-service-manager/plugin.rb
|
64
|
+
- lib/vagrant-service-manager/version.rb
|
64
65
|
- vagrant-service-manager.gemspec
|
65
66
|
- vagrant-service-manager.spec
|
66
67
|
homepage: https://github.com/projectatomic/vagrant-service-manager
|