vagrant-shell 0.2.15 → 0.2.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -7
- data/README.md +8 -22
- data/VERSION +1 -0
- data/lib/vagrant-shell/config.rb +9 -1
- data/lib/vagrant-shell/ssh-agent.rb +23 -0
- data/lib/vagrant-shell/version.rb +1 -1
- data/libexec/shell-docker +4 -0
- data/libexec/{shell-aws → shell-ec2} +0 -0
- data/libexec/{shell-self → shell-static} +2 -2
- metadata +23 -38
- data/.gitignore +0 -7
- data/.gitsetup.yml +0 -4
- data/Gemfile +0 -3
- data/Gemfile.lock +0 -14
- data/Makefile +0 -6
- data/vagrant-shell.gemspec +0 -51
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
Y2I5ZjBlNjJlNjI1Y2MwZGY2ZWNkY2JlNjkzN2YxN2Q3YTlmZDFjNQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YWNjZjBmNDA5YWZjYzdkYmQ2OTBmNDgwMGYzMGExOWE1ZDcwNjRhZA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZDhiYjNkNGFiNjM5NWVkOTAzMDBlZWQ0YmJhMjcwMTlhNzczY2ZmYzc1MTdh
|
10
|
+
OWVkNGMzNjg4Yzc4YmRmMTg1NGNiNjQ3Yjg2NzRkYWE3N2YwZWMzYjRiYTRl
|
11
|
+
ZTg4MjI5NGVkZmU4ZWU5NTFhYWJjN2NjZDVjMTlhZDY5ODM1MzE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODBlOTUxNzQ2MGNjYjZlNDY3YzM1NzAyZTU2ZTFhYjYzMzgyYjcxMTI0YzZi
|
14
|
+
N2Y3ODlhMmZiNzAyNWEzYzRlNmFiNGM2NWY3YmIzMjEwYmE5NjNkYTJhYWZh
|
15
|
+
NTEyNjE3M2Q1Y2Q2MmI2NGYyNGUzNzQxNTNhZTY1ZGJkMzQ0YjQ=
|
data/README.md
CHANGED
@@ -11,8 +11,7 @@ terminate-instance, ssh-info, and read-state.
|
|
11
11
|
|
12
12
|
See `libexec/shell-docker` for an example.
|
13
13
|
|
14
|
-
**NOTE:** This plugin requires
|
15
|
-
README was tested using Ubuntu Raring.
|
14
|
+
**NOTE:** This plugin requires ruby 1.9 and bundler
|
16
15
|
|
17
16
|
## Demo
|
18
17
|
|
@@ -21,37 +20,24 @@ bundler and cached gems.
|
|
21
20
|
|
22
21
|
Go to the demo directory:
|
23
22
|
|
24
|
-
cd demo
|
25
|
-
|
26
|
-
Run make to bundle gems, install the demo vagrant box:
|
27
|
-
|
28
|
-
make
|
23
|
+
cd demo/docker
|
29
24
|
|
30
25
|
Download the ubuntu docker image:
|
31
26
|
|
32
27
|
docker pull ubuntu
|
33
28
|
|
29
|
+
Run make to bundle gems, install the demo vagrant box:
|
30
|
+
|
31
|
+
make
|
32
|
+
|
34
33
|
Bring up the docker containers:
|
35
34
|
|
36
35
|
bundle exec vagrant up
|
36
|
+
bundle exec vagrant status
|
37
37
|
|
38
38
|
The commands passed to the container are sourced from `libexec/init-docker`.
|
39
39
|
It sets up the root user with an ssh key suitable for vagrant.
|
40
40
|
|
41
41
|
SSH into one of the the containers:
|
42
42
|
|
43
|
-
bundle exec vagrant ssh
|
44
|
-
|
45
|
-
## Testing without docker
|
46
|
-
|
47
|
-
If docker is not available, use script `shell-self` to pretend the
|
48
|
-
localhost is the vagrant instance. Be careful since `vagrant ssh` will
|
49
|
-
connect to the localhost.
|
50
|
-
|
51
|
-
Prepend `env SHELL_SCRIPT=self` to `bundle exec vagrant` so the
|
52
|
-
`Vagrantfile` will adjust its docker behavior to suit localhost.
|
53
|
-
|
54
|
-
## TODO
|
55
|
-
|
56
|
-
vagrant package
|
57
|
-
vagrant reload?
|
43
|
+
bundle exec vagrant ssh ubuntu:precise
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2.16
|
data/lib/vagrant-shell/config.rb
CHANGED
@@ -79,7 +79,15 @@ module VagrantPlugins
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def find_script name
|
82
|
-
File.
|
82
|
+
try_path = ENV['PATH'].split(/:/).flatten.inject([]) { |acc, p| x = File.join(p,"shell-#{name.to_s}"); File.exists?(x) && acc << x; acc }.first
|
83
|
+
if try_path
|
84
|
+
return try_path
|
85
|
+
end
|
86
|
+
|
87
|
+
try_load = $:.inject([]) { |acc, p| x = File.expand_path("../libexec/shell-#{name.to_s}", p); File.exists?(x) && acc << x; acc }.first
|
88
|
+
if try_load
|
89
|
+
return try_load
|
90
|
+
end
|
83
91
|
end
|
84
92
|
|
85
93
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# fool vagrant into using ssh-agent keys instead of a fixed key on file
|
2
|
+
module Vagrant
|
3
|
+
module Util
|
4
|
+
class Platform
|
5
|
+
def self.solaris?
|
6
|
+
true
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
require "net/ssh"
|
13
|
+
|
14
|
+
module Net::SSH
|
15
|
+
class << self
|
16
|
+
alias_method :old_start, :start
|
17
|
+
|
18
|
+
def start(host, username, opts)
|
19
|
+
opts[:keys_only] = false
|
20
|
+
self.old_start(host, username, opts)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/libexec/shell-docker
CHANGED
File without changes
|
@@ -16,7 +16,7 @@ case "$cmd" in
|
|
16
16
|
image="$1"; shift
|
17
17
|
debug "run-instance $image"
|
18
18
|
debug "run-instance args: $* 1>&2"
|
19
|
-
echo $
|
19
|
+
echo "$image"
|
20
20
|
;;
|
21
21
|
terminate-instance)
|
22
22
|
instance="$1"; shift
|
@@ -26,7 +26,7 @@ case "$cmd" in
|
|
26
26
|
instance="$1"; shift
|
27
27
|
debug "ssh-info $instance"
|
28
28
|
debug "ssh-info: 127.0.0.1 22"
|
29
|
-
echo "
|
29
|
+
echo "${instance} 22"
|
30
30
|
;;
|
31
31
|
read-state)
|
32
32
|
instance="$1"; shift
|
metadata
CHANGED
@@ -1,32 +1,24 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-shell
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.16
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Tom Bombadil
|
8
8
|
- Mitchell Hashimoto
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2014-01-17 00:00:00 Z
|
12
|
+
date: 2014-01-17 00:00:00.000000000 Z
|
14
13
|
dependencies: []
|
15
|
-
|
16
14
|
description: Enables Vagrant to manage machines using shell scripts
|
17
|
-
email:
|
15
|
+
email:
|
18
16
|
- amanibhavam@destructuring.org
|
19
17
|
- mitchell@hashicorp.com
|
20
18
|
executables: []
|
21
|
-
|
22
19
|
extensions: []
|
23
|
-
|
24
20
|
extra_rdoc_files: []
|
25
|
-
|
26
|
-
files:
|
27
|
-
- CHANGELOG.md
|
28
|
-
- Gemfile
|
29
|
-
- Gemfile.lock
|
21
|
+
files:
|
30
22
|
- lib/vagrant-shell/action/is_created.rb
|
31
23
|
- lib/vagrant-shell/action/message_already_created.rb
|
32
24
|
- lib/vagrant-shell/action/message_not_created.rb
|
@@ -40,46 +32,39 @@ files:
|
|
40
32
|
- lib/vagrant-shell/errors.rb
|
41
33
|
- lib/vagrant-shell/plugin.rb
|
42
34
|
- lib/vagrant-shell/provider.rb
|
35
|
+
- lib/vagrant-shell/ssh-agent.rb
|
43
36
|
- lib/vagrant-shell/util/timer.rb
|
44
37
|
- lib/vagrant-shell/version.rb
|
45
38
|
- lib/vagrant-shell.rb
|
46
|
-
-
|
39
|
+
- locales/en.yml
|
47
40
|
- libexec/shell-docker
|
48
|
-
- libexec/shell-
|
41
|
+
- libexec/shell-ec2
|
42
|
+
- libexec/shell-static
|
43
|
+
- CHANGELOG.md
|
49
44
|
- LICENSE
|
50
|
-
- locales/en.yml
|
51
|
-
- Makefile
|
52
45
|
- README.md
|
53
|
-
-
|
54
|
-
- vagrant-shell.gemspec
|
55
|
-
- .gitignore
|
56
|
-
- .gitsetup.yml
|
46
|
+
- VERSION
|
57
47
|
homepage: http://destructuring.org/vagrant-shell
|
58
48
|
licenses: []
|
59
|
-
|
60
49
|
metadata: {}
|
61
|
-
|
62
50
|
post_install_message:
|
63
51
|
rdoc_options: []
|
64
|
-
|
65
|
-
require_paths:
|
52
|
+
require_paths:
|
66
53
|
- lib
|
67
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
requirements:
|
69
|
-
- -
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version:
|
72
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
76
63
|
version: 1.3.6
|
77
64
|
requirements: []
|
78
|
-
|
79
65
|
rubyforge_project: vagrant-shell
|
80
66
|
rubygems_version: 2.1.11
|
81
67
|
signing_key:
|
82
68
|
specification_version: 4
|
83
69
|
summary: Enables Vagrant to manage machines using shell scripts
|
84
70
|
test_files: []
|
85
|
-
|
data/.gitignore
DELETED
data/.gitsetup.yml
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
data/Makefile
DELETED
data/vagrant-shell.gemspec
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
$:.unshift File.expand_path("../lib", __FILE__)
|
2
|
-
require "vagrant-shell/version"
|
3
|
-
|
4
|
-
Gem::Specification.new do |s|
|
5
|
-
s.name = "vagrant-shell"
|
6
|
-
s.version = VagrantPlugins::Shell::VERSION
|
7
|
-
s.platform = Gem::Platform::RUBY
|
8
|
-
s.authors = [ "Tom Bombadil", "Mitchell Hashimoto" ]
|
9
|
-
s.email = [ "amanibhavam@destructuring.org", "mitchell@hashicorp.com" ]
|
10
|
-
s.homepage = "http://destructuring.org/vagrant-shell"
|
11
|
-
s.summary = "Enables Vagrant to manage machines using shell scripts"
|
12
|
-
s.description = "Enables Vagrant to manage machines using shell scripts"
|
13
|
-
|
14
|
-
s.required_rubygems_version = ">= 1.3.6"
|
15
|
-
s.rubyforge_project = "vagrant-shell"
|
16
|
-
|
17
|
-
# The following block of code determines the files that should be included
|
18
|
-
# in the gem. It does this by reading all the files in the directory where
|
19
|
-
# this gemspec is, and parsing out the ignored files from the gitignore.
|
20
|
-
# Note that the entire gitignore(5) syntax is not supported, specifically
|
21
|
-
# the "!" syntax, but it should mostly work correctly.
|
22
|
-
root_path = File.dirname(__FILE__)
|
23
|
-
all_files = Dir.chdir(root_path) { Dir.glob("**/{*,.*}") }
|
24
|
-
all_files.reject! { |file| [".", ".."].include?(File.basename(file)) }
|
25
|
-
gitignore_path = File.join(root_path, ".gitignore")
|
26
|
-
gitignore = File.readlines(gitignore_path)
|
27
|
-
gitignore.map! { |line| line.chomp.strip }
|
28
|
-
gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
|
29
|
-
|
30
|
-
unignored_files = all_files.reject do |file|
|
31
|
-
# Ignore any directories, the gemspec only cares about files
|
32
|
-
next true if File.directory?(file)
|
33
|
-
|
34
|
-
# Ignore any paths that match anything in the gitignore. We do
|
35
|
-
# two tests here:
|
36
|
-
#
|
37
|
-
# - First, test to see if the entire path matches the gitignore.
|
38
|
-
# - Second, match if the basename does, this makes it so that things
|
39
|
-
# like '.DS_Store' will match sub-directories too (same behavior
|
40
|
-
# as git).
|
41
|
-
#
|
42
|
-
gitignore.any? do |ignore|
|
43
|
-
File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
|
44
|
-
File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
s.files = unignored_files
|
49
|
-
s.executables = unignored_files.map { |f| f[/^bin\/(.*)/, 1] }.compact
|
50
|
-
s.require_path = 'lib'
|
51
|
-
end
|