santoku 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb52db36d32657b634327f65e244f02cb9994390
4
- data.tar.gz: 132f2d8bb28bb26773bbec2a4c19bbcec0c6639f
3
+ metadata.gz: 5f3e96b1ed8dc6727e9a6fd000c91a9da0acdae3
4
+ data.tar.gz: b9585d19579e422da3546ae537a9bd9928d038a1
5
5
  SHA512:
6
- metadata.gz: ee647aa900f3d34521211f176c34a0ee9f717bc722974e811f04a7de15c08060cb7d2320b2885cbfdfa3cdf2462d3e668d95215ba4f0ff3c14313133b95b2507
7
- data.tar.gz: 55a051ddb3cb0379f983bef058bdd6d41e7637f8e39a783ae853d0d658c3681f73bf9f5093519a892f9ff1d2e6813bec9326760f5621a07a26b13bf187a6f339
6
+ metadata.gz: 7ff6d526ff71e412d737016f40de087cc6c876538f64fe612d80dd4935060190551818c8aa799ec524824977f15760ea40504d8f0e497c85a8a0d8fa44a7d0f8
7
+ data.tar.gz: 09373c8a5bc4d426e5ead8018e47119b871a99f26b03481ff7a43d6163804f9212c2099746ddeeb482c85c1c05ae110a4192f59d1b24dcb8a62127e7e8c4b079
data/README.md CHANGED
@@ -1,11 +1,55 @@
1
- santoku
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
- install
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
- This is just a proof of concept for now. Install with:
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.
@@ -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("exit-status") do |ch,data|
23
+ channel.on_request('exit-status') do |ch,data|
24
24
  exit_code = data.read_long
25
25
  end
26
26
  end
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'santoku'
3
- spec.version = '0.0.6'
3
+ spec.version = '0.0.7'
4
4
  spec.executables << 'santoku'
5
- spec.date = '2013-11-17'
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.6
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-17 00:00:00.000000000 Z
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.3
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