right_chimp 1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e09b15f187436252531ccd9b94d249cddceac907
4
+ data.tar.gz: 95490f6e40c38ebeb1da91396ffc3b17db0c9916
5
+ SHA512:
6
+ metadata.gz: c979e8dd6652009e1c0b55f3345167eb868d97bf1edcf6ddb52448aba766954de662433735498c55fd0f984b65d48dbbde6d9e2a8891b4a88b69c567555dd7c7
7
+ data.tar.gz: bb0e17fd39c8709770ca2792064028ddcb30361b85251b51b2fedf8b531335b3e450396ec1ddce8c991f0a65808be49007091e41ed44617a84a6b5bb6702f7b2
data/CHANGES ADDED
@@ -0,0 +1,88 @@
1
+ Version 0.2.0
2
+ --------------
3
+ * Initial non-alpha release
4
+
5
+ Version 0.2.2
6
+ -------------
7
+ * Feature: you can now specify a --script via its URI
8
+ * Feature: initial release of chimpd
9
+
10
+ Version 0.2.3
11
+ -------------
12
+ * Bugfix: chimpd job id management was broken in some places
13
+
14
+ Version 0.3.0
15
+ -------------
16
+ * Feature: New --dry-run option
17
+ * Feature: Array instance execution now includes error checking (requires API 0.1)
18
+ * Change: The work queue is now sorted by server name initially
19
+ * Change: Refactored chimp and chimpd scripts into Real Ruby Objects
20
+
21
+ Version 0.4.0
22
+ -------------
23
+ * Feature: "chimpd --exit" can be used to stop a chimpd server
24
+ * Feature: chimp will now display a list of scripts to choose from
25
+
26
+ Version 0.4.1
27
+ -------------
28
+ * Feature: specify --script via numerical script id instead of full href
29
+ * Bugfix: fixed --script href bug
30
+ * Bugfix: fix chimpd submission from chimp exit code
31
+
32
+ Version 0.4.2
33
+ -------------
34
+ * Bugfix: fixed chimpd submission
35
+ * Feature: Improved ability to ignore runaway tasks in chimpd
36
+
37
+ Version 0.4.3
38
+ -------------
39
+ * Feature: If ServerArrays cannot be found, print a warning instead of failing
40
+
41
+ Version 0.4.5
42
+ -------------
43
+ * Feature: add support for setting inputs when executing RightScripts (--input)
44
+ * Feature: add ignore-errors command line flag
45
+ * Feature: now using the USER environment variable for ssh jobs
46
+
47
+ Version 0.4.6
48
+ -------------
49
+ * Bugfix: add --ssh-user flag to replace buggy USER env. variable feature
50
+
51
+ Version 0.4.8
52
+ -------------
53
+ * Bugfix: chimpd --verbose
54
+
55
+ Version 0.4.9
56
+ -------------
57
+ * Feature: log actions to file
58
+ * Feature: retry/cancel all button added to chimpd
59
+
60
+ Version 0.5.0
61
+ -------------
62
+ * Feature: rewrite of queue system to support task grouping
63
+ * Feature: detailed execution time reporting
64
+ * Feature: new chimpd web interface skin
65
+ * Feature: retry failed and cancel running
66
+ * Feature: improved logging in chimpd
67
+
68
+ Version 0.5.1
69
+ -------------
70
+ * Feature: move run_script_on_instances from API 0.1 to API 1.0 (rest_connection 06df205d7f)
71
+
72
+ Version 0.5.2
73
+ -------------
74
+ * Feature: --noverify flag disables interactive verification of errors
75
+
76
+ Version 0.5.3
77
+ -------------
78
+ * Bugfix: non-operational array instances are no longer operated upon
79
+
80
+ Version 0.5.4
81
+ -------------
82
+ * Bugfix: reduce log output during reporting
83
+ * Feature: The --report flag now sets quiet mode and concurrency=5 by default
84
+
85
+ Version 0.5.5
86
+ -------------
87
+ * Bugfix: --limit flag wasn't sorting servers before executing
88
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ # A sample Gemfile
2
+ source "https://rubygems.org"
3
+
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,49 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ right_chimp (1.0)
5
+ progressbar (~> 0.11.0)
6
+ rake (~> 0.9.2.2)
7
+ rest-client (~> 1.6.7)
8
+ rest_connection (~> 1.0.6)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ activesupport (3.2.13)
14
+ i18n (= 0.6.1)
15
+ multi_json (~> 1.0)
16
+ diff-lcs (1.1.3)
17
+ highline (1.6.18)
18
+ i18n (0.6.1)
19
+ json (1.7.7)
20
+ mime-types (1.23)
21
+ multi_json (1.7.2)
22
+ net-ssh (2.6.7)
23
+ nokogiri (1.5.9)
24
+ progressbar (0.11.0)
25
+ rake (0.9.2.2)
26
+ rest-client (1.6.7)
27
+ mime-types (>= 1.16)
28
+ rest_connection (1.0.6)
29
+ activesupport
30
+ highline
31
+ json
32
+ net-ssh
33
+ nokogiri
34
+ rest-client
35
+ rspec (2.6.0)
36
+ rspec-core (~> 2.6.0)
37
+ rspec-expectations (~> 2.6.0)
38
+ rspec-mocks (~> 2.6.0)
39
+ rspec-core (2.6.4)
40
+ rspec-expectations (2.6.0)
41
+ diff-lcs (~> 1.1.2)
42
+ rspec-mocks (2.6.0)
43
+
44
+ PLATFORMS
45
+ ruby
46
+
47
+ DEPENDENCIES
48
+ right_chimp!
49
+ rspec (~> 2.6.0)
data/INSTALL ADDED
@@ -0,0 +1,25 @@
1
+ INSTALLING FROM GEM
2
+ -------------------
3
+
4
+ This is the easiest way to get up and running with chimp. Make sure you have
5
+ Ruby and RubyGems installed. You can then install on your system by using the
6
+ following command:
7
+
8
+ gem install chimp-<version>.gem
9
+
10
+ INSTALLING FROM SOURCE
11
+ ----------------------
12
+
13
+ If you want to hack on chimp or just run unstable code, then you've come to
14
+ the right place! To install chimp from source, first make sure you have
15
+ all the required gems installed. Change to the chimp source directory and
16
+ execute:
17
+
18
+ bundle install
19
+
20
+ Chimp uses a rakefile to perform most common operations. For a complete list
21
+ of rake targets, please see "rake -T". To build and install the gem:
22
+
23
+ rake build
24
+ rake install
25
+
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011-2012 RightScale, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,80 @@
1
+ Chimp: a command-line tool for remote command execution using the RightScale platform
2
+
3
+ The goal of the Chimp is to provide a simple command line utility for
4
+ performing bulk operations on servers managed on the RightScale platform.
5
+
6
+ EXAMPLE USAGE
7
+ -------------
8
+
9
+ Run a RightScript on every server with a given tag:
10
+
11
+ chimp --tag="service:myservice=true" --script="My RightScript"
12
+
13
+ Run a RightScript on every server in an array:
14
+
15
+ chimp --array=moo1:replicant81 --script='APP Rainbows'
16
+
17
+ Run a shell command on servers with a specific tag:
18
+
19
+ chimp --tag="service:myservice=true" --ssh="uptime"
20
+
21
+ Run a report:
22
+
23
+ bin/chimp --tag="service:myservice=true" --report="nickname,ip-address,tag=myservice:version"
24
+
25
+ REPORTING
26
+ ---------
27
+
28
+ Via the --report command line option it's possible to generate a CSV
29
+ report based on a tag query. Multiple fields to include in a report can
30
+ be specified in a comma delimited list:
31
+
32
+ chimp --report="nickname,ip-address"
33
+
34
+ Would include both the server nickname and ip address to the report:
35
+
36
+ server1-1.rightscale.com,192.168.0.1
37
+ server1-2.rightscale.com,192.168.0.2
38
+ server1-3.rightscale.com,192.168.0.3
39
+ server1-4.rightscale.com,192.168.0.4
40
+
41
+ Any field present on a rest_connection Server object can be queried. This
42
+ includes:
43
+
44
+ Field Example
45
+ ----------------------------------- ----------------------------
46
+ aws-id i-12345
47
+ aws-platform Linux/Unix
48
+ cloud_id
49
+ created_at
50
+ current_instance_href
51
+ deployment_href
52
+ dns-name ec2-50-17-195-218.compute-1.amazonaws.com
53
+ ec2-availability-zone us-east-1a
54
+ ec2-instance-type c1.medium
55
+ ec2-security-groups-href
56
+ ec2-ssh-key-href
57
+ href
58
+ ip-address 50.17.195.12
59
+ locked false
60
+ nickname
61
+ pricing on_demand
62
+ private-dns-name
63
+ private-ip-address 10.10.1.1
64
+ server_template_href
65
+ server_type ec2
66
+ state operational
67
+ updated_at 2011/10/18 21:53:56 +0000
68
+
69
+ Additionally you can report on instance tags:
70
+
71
+ chimp --report="nickname,tag=service:myservice"
72
+
73
+ server1-1.rightscale.com,service:id=1
74
+ server1-2.rightscale.com,service:id=2
75
+ server1-3.rightscale.com,service:id=3
76
+ server1-4.rightscale.com,service:id=4
77
+
78
+ OBLIGATORY MAINTENANCE STRING
79
+ -----------------------------
80
+ maintained by Red_Team
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'bundler/gem_tasks'
3
+
4
+ desc "Open an irb session preloaded with Chimp"
5
+ task :console do
6
+ sh "irb -rubygems -I lib -r lib/right_chimp.rb"
7
+ end
8
+
9
+ desc "Run rspec tests"
10
+ task :spec do
11
+ sh "rspec spec/spec_*.rb"
12
+ end
13
+
14
+ desc "Clean up source directories and packages"
15
+ task :clean do
16
+ sh "rm -rf pkg/*.gem 2>/dev/null || true"
17
+ sh "rm *~ */*~ */*/*~ 2>/dev/null || true"
18
+ end
data/bin/chimp ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Chimp - a command-line tool for the RightScale Platform
4
+ #
5
+ # Copyright (c) 2011-2012 RightScale Inc.
6
+ #
7
+
8
+ require 'rubygems'
9
+ require 'bundler'
10
+ require 'right_chimp'
11
+
12
+ Chimp::Chimp.new.run
data/bin/chimpd ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # chimpd -- the chimp daemon
4
+ #
5
+ # Copyright (c) 2011 RightScale Inc.
6
+ #
7
+
8
+ require 'rubygems'
9
+ require 'bundler'
10
+ require 'right_chimp'
11
+
12
+ Chimp::ChimpDaemon.instance.run
data/chimp.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "right_chimp/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "right_chimp"
7
+ s.version = Chimp::VERSION
8
+ s.authors = ["Christopher Deutsch"]
9
+ s.email = ["christopher@rightscale.com"]
10
+ s.homepage = "https://github.com/rightscale/right_chimp"
11
+ s.summary = %q{RightScale platform command-line tool}
12
+ s.description = %q{The Chimp is a tool for managing servers using the RightScale platform.}
13
+
14
+ # s.rubyforge_project = "chimp"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency "progressbar", "~> 0.11.0"
22
+ s.add_dependency "rest-client", "~> 1.6.7"
23
+ s.add_dependency "rake", "~> 0.9.2.2"
24
+ s.add_dependency "rest_connection", "~> 1.0.6"
25
+
26
+ s.add_development_dependency "rspec", "~> 2.6.0"
27
+ end