koma 0.10.0 → 0.10.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 +4 -4
- data/README.md +5 -5
- data/lib/koma/backend/ssh.rb +7 -5
- data/lib/koma/cli.rb +1 -1
- data/lib/koma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5587b2e28c83b821c268b46ee8fb55e0703b59d2
|
4
|
+
data.tar.gz: e8e20af923807a34b761d67783502f178517a56e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a1792a8a5b07b706ff5af04b9ecebba986e70e7989414bff39c9e0c450113438a43867ffebdbffffc4841a66290511e353c3069464725c29295ac064ce3a156
|
7
|
+
data.tar.gz: 54251c646ee8ff76ba963079bb7cd66e1a616f049a84ce62ae7d7f7d79c6818c867931657ba7b3b7005322a7aa2567dd48ab10eefc49307c2c959437076dcd7c
|
data/README.md
CHANGED
@@ -30,9 +30,9 @@ If you login remote server via `ssh example.com`, you can execute:
|
|
30
30
|
$ koma ssh example.com
|
31
31
|
```
|
32
32
|
|
33
|
-
And
|
33
|
+
And gather host inventory stdout like [this](stdout_sample.json).
|
34
34
|
|
35
|
-
### Gather multiple hosts
|
35
|
+
### Gather host inventory from multiple hosts
|
36
36
|
|
37
37
|
```sh
|
38
38
|
$ koma ssh example.com,example.jp
|
@@ -46,7 +46,7 @@ $ koma ssh example.com,example.jp
|
|
46
46
|
}
|
47
47
|
```
|
48
48
|
|
49
|
-
### Pro Tip: Gather multiple hosts with ssh_config
|
49
|
+
### Pro Tip: Gather host inventory from multiple hosts with ssh_config
|
50
50
|
|
51
51
|
```sh
|
52
52
|
$ cat <<EOF > ssh_config_tmp
|
@@ -66,13 +66,13 @@ EOF
|
|
66
66
|
$ cat ssh_config_tmp | koma ssh --key platform,platform_version
|
67
67
|
```
|
68
68
|
|
69
|
-
Use [sconb](https://github.com/k1LoW/sconb).
|
69
|
+
Use [sconb](https://github.com/k1LoW/sconb) to filter ~/.ssh/config.
|
70
70
|
|
71
71
|
```sh
|
72
72
|
$ sconb dump example_* | sconb restore | koma ssh --key platform,platform_version
|
73
73
|
```
|
74
74
|
|
75
|
-
Gather vagrant
|
75
|
+
Gather vagrant host inventory.
|
76
76
|
|
77
77
|
```sh
|
78
78
|
$ vagrant ssh-config | koma ssh --key cpu,kernel
|
data/lib/koma/backend/ssh.rb
CHANGED
@@ -42,11 +42,13 @@ module Koma
|
|
42
42
|
def run_command_via_ssh(host, options, command)
|
43
43
|
set :ssh_options, build_ssh_options(host, options)
|
44
44
|
result = Specinfra.backend.run_command(command)
|
45
|
-
{
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
{ command =>
|
46
|
+
{
|
47
|
+
exit_signal: result.exit_signal,
|
48
|
+
exit_status: result.exit_status,
|
49
|
+
stderr: result.stderr,
|
50
|
+
stdout: result.stdout
|
51
|
+
}
|
50
52
|
}
|
51
53
|
end
|
52
54
|
|
data/lib/koma/cli.rb
CHANGED
@@ -39,7 +39,7 @@ module Koma
|
|
39
39
|
option :identity_file, type: :string, banner: '<identity_file>', desc: 'identity file', aliases: :i
|
40
40
|
option :port, type: :numeric, banner: '<port>', desc: 'port', aliases: :p
|
41
41
|
def run_command(host = nil, command = nil)
|
42
|
-
if
|
42
|
+
if host.nil?
|
43
43
|
STDERR.puts 'ERROR: "koma run-command" was called with no arguments'
|
44
44
|
STDERR.puts 'Usage: "koma run-command <host1,host2,..> <command>"'
|
45
45
|
return
|
data/lib/koma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: koma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|