santoku 0.0.6 → 0.0.7
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 +49 -5
- data/lib/santoku/ssh.rb +3 -3
- data/santoku.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f3e96b1ed8dc6727e9a6fd000c91a9da0acdae3
|
4
|
+
data.tar.gz: b9585d19579e422da3546ae537a9bd9928d038a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ff6d526ff71e412d737016f40de087cc6c876538f64fe612d80dd4935060190551818c8aa799ec524824977f15760ea40504d8f0e497c85a8a0d8fa44a7d0f8
|
7
|
+
data.tar.gz: 09373c8a5bc4d426e5ead8018e47119b871a99f26b03481ff7a43d6163804f9212c2099746ddeeb482c85c1c05ae110a4192f59d1b24dcb8a62127e7e8c4b079
|
data/README.md
CHANGED
@@ -1,11 +1,55 @@
|
|
1
|
-
|
1
|
+
Santoku
|
2
2
|
=======
|
3
3
|
|
4
|
-
Parrallel ssh commands over chef servers with rspec-like output
|
4
|
+
Parrallel ssh commands over chef servers with rspec-like output. Santoku uses the exit codes of a command to determine whether it qualifies as a success or failure.
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
Installation
|
7
|
+
============
|
8
|
+
|
9
|
+
## Requirements
|
10
|
+
|
11
|
+
* Ruby 1.9.3+
|
12
|
+
* [Knife configuration file](http://docs.opscode.com/config_rb_knife.html)
|
8
13
|
|
9
|
-
|
14
|
+
Install the gem:
|
10
15
|
|
11
16
|
gem install santoku
|
17
|
+
|
18
|
+
Usage
|
19
|
+
=====
|
20
|
+
|
21
|
+
`santoku test COMMAND [QUERY]` or `santoku -t COMMAND [QUERY]`
|
22
|
+
|
23
|
+
## Test command
|
24
|
+
|
25
|
+
Test if a given command returns 0 on all nodes:
|
26
|
+
|
27
|
+
santoku -t 'test -d /foo/bar/'
|
28
|
+
|
29
|
+
Test if a given command **does not** return 0 on nodes:
|
30
|
+
|
31
|
+
santoku -t 'php -i | grep -i memcached' --invert
|
32
|
+
|
33
|
+
Test if a given command returns 0 on all nodes, also print out the STDOUT of successfull commands:
|
34
|
+
|
35
|
+
santoku -t 'cat /etc/apache2/conf.d/ssl' --print-success
|
36
|
+
|
37
|
+
Test if a given command returns 0, scoped on certain nodes (with [knife search syntax](http://docs.opscode.com/knife_search.html)):
|
38
|
+
|
39
|
+
santoku -t 'test -f /etc/apache2/conf.d/ssl' 'recipe:apache AND listen_ports:443'
|
40
|
+
|
41
|
+
### Note
|
42
|
+
|
43
|
+
Santoku is not meant to modify server configurations, only to test how a server replies on a given (non-destructive) command. Use with caution.
|
44
|
+
|
45
|
+
To-do
|
46
|
+
=====
|
47
|
+
|
48
|
+
* Make the output truly RSpec compatible, so we can use RSpec formatters
|
49
|
+
* Stop forcing root user, system user (with sudo) should also work
|
50
|
+
* santoku should not be limited to Chef (main reason this isn't a knife plugin)
|
51
|
+
|
52
|
+
Contributing
|
53
|
+
============
|
54
|
+
|
55
|
+
Bug reports, feature requests and test implementations are more than welcome. Please use [our Github account](https://github.com/openminds/santoku) for this.
|
data/lib/santoku/ssh.rb
CHANGED
@@ -3,8 +3,8 @@ class Santoku
|
|
3
3
|
def ssh_exec!(ssh, command)
|
4
4
|
# I am not awesome enough to have made this method myself
|
5
5
|
# Originally submitted by 'flitzwald' over here: http://stackoverflow.com/a/3386375
|
6
|
-
stdout_data =
|
7
|
-
stderr_data =
|
6
|
+
stdout_data = ''
|
7
|
+
stderr_data = ''
|
8
8
|
exit_code = nil
|
9
9
|
|
10
10
|
ssh.open_channel do |channel|
|
@@ -20,7 +20,7 @@ class Santoku
|
|
20
20
|
stderr_data+=data
|
21
21
|
end
|
22
22
|
|
23
|
-
channel.on_request(
|
23
|
+
channel.on_request('exit-status') do |ch,data|
|
24
24
|
exit_code = data.read_long
|
25
25
|
end
|
26
26
|
end
|
data/santoku.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'santoku'
|
3
|
-
spec.version = '0.0.
|
3
|
+
spec.version = '0.0.7'
|
4
4
|
spec.executables << 'santoku'
|
5
|
-
spec.date = '2013-11-
|
5
|
+
spec.date = '2013-11-26'
|
6
6
|
spec.summary = 'Parrallel ssh commands over chef servers with rspec-like output'
|
7
7
|
spec.description = 'A gem to perform command over parallel ssh connections on multiple chef serverspec. Output is rspec-like.'
|
8
8
|
spec.authors = ['Steven De Coeyer', 'Jeroen Jacobs']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: santoku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven De Coeyer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.0.
|
125
|
+
rubygems_version: 2.0.14
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Parrallel ssh commands over chef servers with rspec-like output
|