ansible-powerplay 0.1.2 → 0.1.3

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: cb40dbf111896bd21d6222190285c8fbe3a8f43a
4
- data.tar.gz: 536a964f3be80cdeee2afa2530e8428c1c214f92
3
+ metadata.gz: 26f7d6031374230d79075a468cb9eb529c46335e
4
+ data.tar.gz: fe9100646231bd39f16d3f3d3da87a717554131e
5
5
  SHA512:
6
- metadata.gz: ff370b7c1b9f5ef1e8a5cb2c18139a39792db7dfb84e7d60a0655f15cf63453c42e429637ed021ed175fa92cf31c6ee719896dc666dee0a402c29f6e972f8bff
7
- data.tar.gz: e3711e106e82a49959da9032dc2c4cd905e117bb49849cf1b4fd8b600139c7cf05a3c9f101193df3df9329124acd4c4af1ed237b4603a4d5a7153570105aa41f
6
+ metadata.gz: ef1b0c04accd7262a739e2a1401e1b9f42ef4142839eb79b66a8ae24b78b79892df46a61616b52280d34c06414eedb99dbe59289709c7d7489b1a7c5152923e9
7
+ data.tar.gz: 73258c610b79f068aead6586b9ba3b2ae47846c944f1fc5730a0944ee1a72e07f29c50c928d38eee3be713fe843acc8a7996ac9da64b925417235dea00379830
data/.semver CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 2
4
+ :patch: 3
5
5
  :special: ''
data/RELEASE_NOTES.org CHANGED
@@ -7,16 +7,17 @@
7
7
  major number. Of course, you can read all about it here.
8
8
 
9
9
  ** Release Notes
10
- | Date | Release | Feature / Bug | Description |
11
- |------------+---------+---------------------------------+----------------------------------------------------------------------------|
12
- | 2016-02-23 | v0.1.2 | --tmux. --no-tmux | Default output now goes to current tty |
13
- | 2016-02-22 | v0.1.1 | --book, --group, --play | Minor bug with the array handling |
14
- | 2016-02-22 | v0.1.0 | --book, --group, --play | Now each can take multiple specifications |
15
- | 2016-02-20 | v0.0.8 | Creation of these Release Notes | About bloody time. The prior releases were all mostly bug fixes, and so... |
16
- | | | --tmux | Now you can optionally specify the window number |
17
- | | | --tmux | Now checks to ensure it does not dump to its own pane |
18
- | | | --book | You can select an individual playbook to run |
19
- | | | --group | You can select an individual group to run |
10
+ | Release | Feature / Bug | Description | Date |
11
+ |---------+---------------------------------+----------------------------------------------------------------------------+------------|
12
+ | v0.1.3 | --tmux | Better handling at distributing the panes. | 2016-02-26 |
13
+ | v0.1.2 | --tmux. --no-tmux | Default output now goes to current tty | 2016-02-23 |
14
+ | v0.1.1 | --book, --group, --play | Minor bug with the array handling | 2016-02-22 |
15
+ | v0.1.0 | --book, --group, --play | Now each can take multiple specifications | 2016-02-22 |
16
+ | v0.0.8 | Creation of these Release Notes | About bloody time. The prior releases were all mostly bug fixes, and so... | 2016-02-20 |
17
+ | | --tmux | Now you can optionally specify the window number | |
18
+ | | --tmux | Now checks to ensure it does not dump to its own pane | |
19
+ | | --book | You can select an individual playbook to run | |
20
+ | | --group | You can select an individual group to run | |
20
21
 
21
22
  ** Known Outstanding Issues
22
23
  Bugs and missing features that needs to be addressed. As they are,
@@ -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.1.2 ruby lib
5
+ # stub: ansible-powerplay 0.1.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "ansible-powerplay"
9
- s.version = "0.1.2"
9
+ s.version = "0.1.3"
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-23"
14
+ s.date = "2016-02-26"
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"]
@@ -34,3 +34,4 @@ module Powerplay
34
34
  end
35
35
  end
36
36
  end
37
+
@@ -1,6 +1,8 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'ansible-powerplay'
3
3
 
4
+ CRITICAL = Mutex.new
5
+
4
6
  module Powerplay
5
7
  module Play
6
8
  def self.clopts
@@ -16,7 +18,7 @@ module Powerplay
16
18
  # Get a list of the ptys
17
19
  # Note that this code is a bit innefficient, but will only be
18
20
  # executed once in the loop.
19
- def self.pane_ptys
21
+ def self.pane_ttys
20
22
  @window = if Play::clopts.nil? or Play::clopts[:tmux] == 0
21
23
  ''
22
24
  else
@@ -34,6 +36,17 @@ module Powerplay
34
36
  [current_tty]
35
37
  end
36
38
  end
39
+
40
+ # thread-safe way to grab a new tty
41
+ def self.grab_a_tty
42
+ tty = nil
43
+ CRITICAL.synchronize {
44
+ @@tty_count ||= -1
45
+ @@tty_count = (@@tty_count+1) % pane_ttys.size
46
+ tty = pane_ttys[@@tty_count]
47
+ }
48
+ tty
49
+ end
37
50
  end
38
51
 
39
52
  module Ansible
@@ -68,9 +81,9 @@ module Powerplay
68
81
  puts " GROUP #{group.type} (book=#{bucher}, cg=#{congroups}) -->"
69
82
  thrbooks = []
70
83
  errors = []
71
- group.books.zip(Tmux.pane_ptys) do |book, tty|
72
- tty ||= Tmux.pane_ptys.last
73
- puts " tty == #{tty} (#{Tmux.pane_ptys.last})" unless DSL::_verbosity < 2
84
+ group.books.each do | book |
85
+ tty ||= Tmux.grab_a_tty
86
+ puts " tty == #{tty} (#{Tmux.pane_ttys.last})" unless DSL::_verbosity < 2
74
87
  if bucher.first == :all or bucher.member?(book.type)
75
88
  puts " BOOK #{book.type}"
76
89
  inv = if book.config.member? :inventory
@@ -2,5 +2,6 @@ require 'thor'
2
2
  require 'semver'
3
3
  require 'pp'
4
4
  require 'open3'
5
+ require 'thread'
5
6
  require_relative 'ansible-powerplay/powerplay'
6
7
  require_relative 'ansible-powerplay/dsl'
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.1.2
4
+ version: 0.1.3
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-23 00:00:00.000000000 Z
11
+ date: 2016-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor