ansible-powerplay 0.0.8 → 0.1.0

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: 1deb223eef8d93151294357c9d2ace6207b418a1
4
- data.tar.gz: fb307a3f0392d6700ec79291c66b511fccc992d9
3
+ metadata.gz: f25748f52817b7fd4aeefedfc5f7238ce59d3992
4
+ data.tar.gz: b17865d40e37fbcf118255d869b39ebabe465283
5
5
  SHA512:
6
- metadata.gz: 3009f3ce965b67f6f60c44fe4b77322934b7413f04c27de5fdcf3d72bf602143d63a488180039fbfadacdad4cbf77eb42c9cf1a51013c910666c8779b81489dc
7
- data.tar.gz: efc8f8b9683f9edc5f82916c4ecd7a9534b887343783a1d810440b0361bd784563277da3fd4debbe49d4d28c2d3bcbd85a91a06875d56f7efd1ee02f44b39313
6
+ metadata.gz: 27c502f1dc1c04ad19f683cee0bd8d84e8272c5b1634fa2ed67d508763f2690273fc245645874939b70bf95312f41374333b83da7d501e9c35690f8bca629f93
7
+ data.tar.gz: bdf284f71921605cee317de9f034b1cf3f76be9cedd3b8af5f4f93a3a22fe9f7962520f4da7bf3b26339b790da4faa5f384aed8cdc4628530284f47c0e06b64f
data/.semver CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
- :minor: 0
4
- :patch: 8
3
+ :minor: 1
4
+ :patch: 0
5
5
  :special: ''
data/Gemfile.lock CHANGED
@@ -6,7 +6,7 @@ GEM
6
6
  debug_inspector (>= 0.0.1)
7
7
  builder (3.2.2)
8
8
  byebug (8.2.2)
9
- coderay (1.1.0)
9
+ coderay (1.1.1)
10
10
  concurrent-ruby (1.0.0)
11
11
  debug_inspector (0.0.2)
12
12
  descendants_tracker (0.0.4)
data/README.org CHANGED
@@ -26,6 +26,8 @@
26
26
  #+NAME: Powerplay Example
27
27
  [[./examples/powerplay_screenshot.jpeg]]
28
28
 
29
+ ** Release Notes
30
+ Please see [[RELEASE_NOTES.org][Release Notes]]
29
31
  ** Features and Cavets
30
32
  *** Integration with TMUX
31
33
  When running multiple Ansible Playbooks concurrently,
@@ -162,6 +164,21 @@
162
164
 
163
165
  Both the :rabbit and :es_cluster books would be executed
164
166
  in parallel.
167
+ *** Running Powerplay
168
+ If you type 'powerplay' without parameters, you are greeted with:
169
+ #+BEGIN_SRC doc
170
+ Commands:
171
+ powerplay help [COMMAND] # Describe available commands or one specific command
172
+ powerplay play <script> -p, --play=[NAME|all] Which playbook shelf # Run the powerplay script.
173
+ powerplay ttys # list all the TMUX ptys on the current window.
174
+
175
+ Options:
176
+ -v, [--verbose=[1|2|3]]
177
+ # Default: 0
178
+ #+END_SRC
179
+ Please use the help feature to explain the subcommands and options. We
180
+ shall be adding many more subcommands and options as our needs demands.
181
+ If you like to see something here, please submit it as an issue on Github.
165
182
 
166
183
  *** Example .play Script
167
184
  To play around with the example .play script,
@@ -172,7 +189,7 @@
172
189
  #+END_SRC
173
190
 
174
191
  and go to the examples directory to find test.play.
175
-
192
+
176
193
  *** Submitting your example .play scripts
177
194
  Please feel free to do pull requests of your
178
195
  scripts or submit them to me as Gist snippets
data/RELEASE_NOTES.org ADDED
@@ -0,0 +1,44 @@
1
+ * Ansible Powerplay Release Notes
2
+ With each release, we promise to make some entries here so that
3
+ you may be informed. We shall always try to maintain backwards compability.
4
+
5
+ If something potentially affects backwards compability, we'll bump the minor
6
+ number. For "milestone" upgrades and/or compability breaks, we'll rev the
7
+ major number. Of course, you can read all about it here.
8
+
9
+ ** Relases
10
+ Newer entries shall be listed first.
11
+
12
+ *** v0.1.0 2016-02-22
13
+ | Feature / Bug | Description |
14
+ |-------------------------+-------------------------------------------|
15
+ | --book, --group, --play | Now each can take multiple specifications |
16
+
17
+
18
+ *** v0.0.8 2016-02-20
19
+ | Feature / Bug | Description |
20
+ |---------------------------------+----------------------------------------------------------------------------|
21
+ | Creation of these Release Notes | About bloody time. The prior releases were all mostly bug fixes, and so... |
22
+ | --tmux | Now you can optionally specify the window number |
23
+ | --tmux | Now checks to ensure it does not dump to its own pane |
24
+ | --book | You can select an individual playbook to run |
25
+ | --group | You can select an individual group to run |
26
+
27
+ ** Known Outstanding Issues
28
+ Bugs and missing features that needs to be addressed. As they are,
29
+ we'll remove them from this list.
30
+
31
+ | Date | Issue | Description |
32
+ |------------+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------|
33
+ | 2016-02-20 | Non tmux output | Redirected to stdout, but really needs to go to the current tty. |
34
+ | 2016-02-20 | Platforms other than Linux | We need to test on Mac OSX and Windows. Should work fine on Macs. I do not plan to support Windows in general, but may accept pull requests to that end. |
35
+ | | | |
36
+ ** Wish List
37
+ Well, we can always wish upon a star...
38
+
39
+ | Date | Wish | Description |
40
+ |------------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
41
+ | 2016-02-20 | Integration with Jenkins | I have no idea what form this will take |
42
+ | 2016-02-20 | Curses integration | Basically, the tmux integration is used because it was quick to do. But what I really want to do is full Curses support, similar with what you see with htop and other tools. |
43
+ | | | |
44
+
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: ansible-powerplay 0.0.8 ruby lib
5
+ # stub: ansible-powerplay 0.1.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "ansible-powerplay"
9
- s.version = "0.0.8"
9
+ s.version = "0.1.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Fred Mitchell"]
14
- s.date = "2016-02-19"
14
+ s.date = "2016-02-22"
15
15
  s.description = "Ansible Powerplay, by way of its DSL, allows you to\n specify your Ansible playbooks and their vars, and common\n vars to all, so that you can run your\n indeoendent playbooks in full parallel."
16
16
  s.email = "fred.mitchell@gmx.de"
17
17
  s.executables = ["powerplay"]
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
28
28
  "Gemfile.lock",
29
29
  "LICENSE.txt",
30
30
  "README.org",
31
+ "RELEASE_NOTES.org",
31
32
  "Rakefile",
32
33
  "SCRATCHPAD.org",
33
34
  "ansible-powerplay.gemspec",
@@ -14,10 +14,10 @@ module Powerplay
14
14
  by default.
15
15
  LONGDESC
16
16
  option :tmux, type: :numeric, lazy_default: 0, aliases: '-m', banner: "[WINDOWNUMBERopt] Send output to all tmux panes in the current window, or the numeric window specified."
17
- option :play, type: :string, aliases: '-p', banner: "[NAME|all] Which playbook shelf", required: true
18
- option :group, type: :string, aliases: '-g', banner: "[NAME|all] Which group to execute", default: "all"
17
+ option :play, type: :array, aliases: '-p', banner: "[NAME[ NAME2...]|all] Which playbook shelves", required: true
18
+ option :group, type: :array, aliases: '-g', banner: "[NAME[ NAME2...]|all] Which groups to execute", default: "all"
19
19
  option :congroups, type: :boolean, aliases: '-c', banner: "Run the groups themselves concurrently"
20
- option :book, type: :string, aliases: '-b', banner: "[NAME|all] Which book to execute", default: "all"
20
+ option :book, type: :array, aliases: '-b', banner: "[NAME[ NAME2...]|all] Which books to execute", default: "all"
21
21
  option :dryrun, type: :boolean, aliases: '-u', banner: "Dry run, do not actually execute."
22
22
  def play(script)
23
23
  DSL::_global[:options] = options
@@ -38,26 +38,22 @@ module Powerplay
38
38
  OPTS = ""
39
39
 
40
40
  def self.playbooks
41
- play = Play::clopts[:play].to_sym
42
- if play == :all
43
- DSL::_global[:playbooks].each do |pplay, group|
44
- yield pplay, group
45
- end
46
- else
47
- yield play, DSL::_global[:playbooks][play]
41
+ plays = Play::clopts[:play].map{ |y| y.to_sym }
42
+ DSL::_global[:playbooks].each do |pplay, group|
43
+ yield pplay, group if plays.first == :all or plays.member? pplay
48
44
  end
49
45
  end
50
46
 
51
47
  # groups are serial
52
48
  def self.groups(playbook)
53
- grp = Play::clopts[:group].to_sym
49
+ grps = Play::clopts[:group].map{ |g| g.to_sym}
54
50
  playbook.groups.each do |group|
55
- yield group if grp == :all or grp == group.type
51
+ yield group if grps.first == :all or grps.member?(group.type)
56
52
  end
57
53
  end
58
54
 
59
55
  def self.power_run
60
- buch = Play::clopts[:book].to_sym
56
+ bucher = Play::clopts[:book].map{ |b| b.to_sym }
61
57
  dryrun = Play::clopts[:dryrun]
62
58
  congroups = Play::clopts[:congroups]
63
59
  playbooks do |pname, playbook|
@@ -66,13 +62,13 @@ module Powerplay
66
62
  groups playbook do |group|
67
63
  tg = nil
68
64
  thrgroups << (tg = Thread.new {
69
- puts " GROUP #{group.type} (book=#{buch}, cg=#{congroups}) -->"
65
+ puts " GROUP #{group.type} (book=#{bucher}, cg=#{congroups}) -->"
70
66
  thrbooks = []
71
67
  errors = []
72
68
  group.books.zip(Tmux.pane_ptys) do |book, tty|
73
69
  tty ||= Tmux.pane_ptys.last
74
70
  puts " tty == #{tty} (#{Tmux.pane_ptys.last})" unless DSL::_verbosity < 2
75
- if buch == :all or book.type == buch
71
+ if bucher.first == :all or bucher.member?(book.type)
76
72
  puts " BOOK #{book.type}"
77
73
  inv = if book.config.member? :inventory
78
74
  "-i #{book.config[:inventory].first}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ansible-powerplay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Mitchell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-19 00:00:00.000000000 Z
11
+ date: 2016-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -283,6 +283,7 @@ files:
283
283
  - Gemfile.lock
284
284
  - LICENSE.txt
285
285
  - README.org
286
+ - RELEASE_NOTES.org
286
287
  - Rakefile
287
288
  - SCRATCHPAD.org
288
289
  - ansible-powerplay.gemspec