vagrant-ssh-config-ttl 0.0.1
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 +7 -0
- data/.gitignore +9 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +22 -0
- data/README.md +22 -0
- data/Rakefile +1 -0
- data/lib/vagrant-ssh-config-ttl.rb +8 -0
- data/lib/vagrant-ssh-config-ttl/command.rb +58 -0
- data/lib/vagrant-ssh-config-ttl/plugin.rb +18 -0
- data/lib/vagrant-ssh-config-ttl/tera_term_language_template.erb +14 -0
- data/lib/vagrant-ssh-config-ttl/version.rb +5 -0
- data/vagrant-ssh-config-ttl.gemspec +32 -0
- metadata +84 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f5d8dbd02089b88bf1c8c1c85c0664e7806814df
|
4
|
+
data.tar.gz: c0be64bc93d24b0c32aa3ca57c467a70dee5532e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3ba91e4e0ed039d6b0057be25d6ca34d0dfb62a059bdee9bc24f20aa1e77772c56258dfbe8f925e1ae754de2e50e45286313a9ccaea7757389400d036ea392e8
|
7
|
+
data.tar.gz: 89f24a10fdd2546b96517d7792fbc90af4ad78cfdd60f664b0bf1980b9e45426e8f4e03460bb6a589c03b019868fb2c1737614f296312c53470997632b87df69
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 IIBUN Toshiyuki
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Vagrant Tera Term ssh-config Plugin
|
2
|
+
|
3
|
+
This plugin outputs STDOUT Tera Term Language(TTL) Macro configuration.
|
4
|
+
This plugin works like ssh-config command output.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Run following command on your terminal.
|
9
|
+
|
10
|
+
```
|
11
|
+
vagrant plugin install vagrant-ssh-config-ttl
|
12
|
+
```
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
```
|
17
|
+
$ vagrant ssh-config-ttl
|
18
|
+
```
|
19
|
+
|
20
|
+
## Contributing
|
21
|
+
|
22
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/wnoguchi/vagrant-ssh-config-ttl.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
require "vagrant/util/safe_puts"
|
4
|
+
|
5
|
+
module VagrantPlugins
|
6
|
+
module CommandSSHConfigTTL
|
7
|
+
class Command < Vagrant.plugin("2", :command)
|
8
|
+
include Vagrant::Util::SafePuts
|
9
|
+
|
10
|
+
def self.synopsis
|
11
|
+
"outputs OpenSSH valid configuration to connect to the machine"
|
12
|
+
end
|
13
|
+
|
14
|
+
def execute
|
15
|
+
options = {}
|
16
|
+
|
17
|
+
opts = OptionParser.new do |o|
|
18
|
+
o.banner = "Usage: vagrant ssh-config-ttl [options] [name]"
|
19
|
+
o.separator ""
|
20
|
+
o.separator "Options:"
|
21
|
+
o.separator ""
|
22
|
+
|
23
|
+
o.on("--host NAME", "Name the host for the config") do |h|
|
24
|
+
options[:host] = h
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
argv = parse_options(opts)
|
29
|
+
return if !argv
|
30
|
+
|
31
|
+
with_target_vms(argv) do |machine|
|
32
|
+
ssh_info = machine.ssh_info
|
33
|
+
raise Vagrant::Errors::SSHNotReady if ssh_info.nil?
|
34
|
+
|
35
|
+
variables = {
|
36
|
+
host_key: options[:host] || machine.name || "vagrant",
|
37
|
+
ssh_host: ssh_info[:host],
|
38
|
+
ssh_port: ssh_info[:port],
|
39
|
+
ssh_user: ssh_info[:username],
|
40
|
+
private_key_path: ssh_info[:private_key_path],
|
41
|
+
forward_agent: ssh_info[:forward_agent],
|
42
|
+
forward_x11: ssh_info[:forward_x11],
|
43
|
+
proxy_command: ssh_info[:proxy_command],
|
44
|
+
ssh_command: ssh_info[:ssh_command]
|
45
|
+
}
|
46
|
+
|
47
|
+
# Render the template and output directly to STDOUT
|
48
|
+
template = "vagrant-ssh-config-ttl/tera_term_language_template"
|
49
|
+
safe_puts(Vagrant::Util::TemplateRenderer.render(template, variables))
|
50
|
+
safe_puts
|
51
|
+
end
|
52
|
+
|
53
|
+
# Success, exit status 0
|
54
|
+
0
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "vagrant"
|
2
|
+
|
3
|
+
module VagrantPlugins
|
4
|
+
module CommandSSHConfigTTL
|
5
|
+
class Plugin < Vagrant.plugin("2")
|
6
|
+
name "ssh-config-ttl command"
|
7
|
+
description <<-DESC
|
8
|
+
The `ssh-config-ttl` command dumps an Tera Term Language(TTL) Macro compatible configuration
|
9
|
+
that can be used to quickly SSH into your virtual machine.
|
10
|
+
DESC
|
11
|
+
|
12
|
+
command("ssh-config-ttl") do
|
13
|
+
require File.expand_path("../command", __FILE__)
|
14
|
+
Command
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
HOSTADDR = '<%= ssh_host %>'
|
2
|
+
PORT = '<%= ssh_port %>'
|
3
|
+
USERNAME = '<%= ssh_user %>'
|
4
|
+
COMMAND = HOSTADDR
|
5
|
+
strconcat COMMAND ':'
|
6
|
+
strconcat COMMAND PORT
|
7
|
+
strconcat COMMAND ' /ssh /2 /auth=publickey /user='
|
8
|
+
strconcat COMMAND USERNAME
|
9
|
+
<% private_key_path.each do |path| %>
|
10
|
+
strconcat COMMAND ' /keyfile="<%= path %>"'
|
11
|
+
strconcat COMMAND KEY_FILE
|
12
|
+
<% end -%>
|
13
|
+
connect COMMAND
|
14
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'vagrant-ssh-config-ttl/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "vagrant-ssh-config-ttl"
|
8
|
+
spec.version = VagrantPlugins::CommandSSHConfigTTL::VERSION
|
9
|
+
spec.authors = ["Wataru Noguchi"]
|
10
|
+
spec.email = ["wnoguchi.0727@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{This is a Vagrant Plugin that outputs Tera Term Language(TTL) Macro.}
|
13
|
+
spec.description = %q{This is a Vagrant Plugin that outputs STDOUT Tera Term Language(TTL) Macro configuration. like ssh-config.}
|
14
|
+
spec.homepage = "https://github.com/wnoguchi/vagrant-ssh-config-ttl"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
+
# delete this section to allow pushing this gem to any host.
|
19
|
+
#if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
#else
|
22
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
#end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
spec.bindir = "exe"
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vagrant-ssh-config-ttl
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Wataru Noguchi
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: This is a Vagrant Plugin that outputs STDOUT Tera Term Language(TTL)
|
42
|
+
Macro configuration. like ssh-config.
|
43
|
+
email:
|
44
|
+
- wnoguchi.0727@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- lib/vagrant-ssh-config-ttl.rb
|
55
|
+
- lib/vagrant-ssh-config-ttl/command.rb
|
56
|
+
- lib/vagrant-ssh-config-ttl/plugin.rb
|
57
|
+
- lib/vagrant-ssh-config-ttl/tera_term_language_template.erb
|
58
|
+
- lib/vagrant-ssh-config-ttl/version.rb
|
59
|
+
- vagrant-ssh-config-ttl.gemspec
|
60
|
+
homepage: https://github.com/wnoguchi/vagrant-ssh-config-ttl
|
61
|
+
licenses:
|
62
|
+
- MIT
|
63
|
+
metadata: {}
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
requirements: []
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 2.0.14
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: This is a Vagrant Plugin that outputs Tera Term Language(TTL) Macro.
|
84
|
+
test_files: []
|