ansible-powerplay 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: a59c6967f5d7e959a86e1b746b443fb03ec7031e
4
- data.tar.gz: bd9a4431839188117f0f092c5f4bd8cb013b87c4
3
+ metadata.gz: c5cfb3603dc0e590de6f8fc01c069e1e15d06c59
4
+ data.tar.gz: 46bd40dfeb1db350ed3da7a4b05a25396f7932bf
5
5
  SHA512:
6
- metadata.gz: f7d17b9b006f13de8f541d813b1fad5d18be11763722927eb611015341092f79d5cdec96fc91160cdfd87cead6270448742e3a4a9070bbdce04724c113c2c134
7
- data.tar.gz: e87aaf34027d707437a0ffd9ee94a486571f37e9ff549c535e594eebe9346a7ae7f0a3fe1607ec629b7346a58bb03a12fe8704b365eeec747799ce0556daa37a
6
+ metadata.gz: 3c0fc843b9cf1c6a41ede49e8392914e6a6acab1af54f2d0712ff62eac983a691f68d15f27ca5648a4974eeee1a16323ad4bf7f96118d0d406c5ee852dddd39d
7
+ data.tar.gz: 38ffe69ce84327a335130c73187c11879f98eac8d258d31e71284fad61cef3a9354389cf8c54fc6d8b3fd32113318bacfe30ec6be5b12e094bf1ece2f9a36e42
data/.semver CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 6
4
+ :patch: 7
5
5
  :special: ''
@@ -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.6 ruby lib
5
+ # stub: ansible-powerplay 0.0.7 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "ansible-powerplay"
9
- s.version = "0.0.6"
9
+ s.version = "0.0.7"
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-18"
14
+ s.date = "2016-02-19"
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"]
@@ -3,6 +3,7 @@ module Powerplay
3
3
  module DSL
4
4
  @@config_stack = [{}]
5
5
  @@global_config = {}
6
+ SPECIAL_PARAMS = [:playbook_directory, :inventory]
6
7
 
7
8
  def _bump
8
9
  @@config_stack.push @@config_stack.last.clone
@@ -62,9 +63,10 @@ module Powerplay
62
63
  end
63
64
 
64
65
  # Ansible playbook parameters
65
- # TODO: there is a bogus playbook_directory param here.
66
66
  def aparams
67
- config.map{ |k,v| "#{k}=#{v.first}"}.join(' ')
67
+ config.map{ |k,v|
68
+ "#{k}=#{v.first}" unless DSL::SPECIAL_PARAMS.member?(k)
69
+ }.compact.join(' ')
68
70
  end
69
71
  end
70
72
 
@@ -39,8 +39,8 @@ module Powerplay
39
39
  def self.playbooks
40
40
  play = Play::clopts[:play].to_sym
41
41
  if play == :all
42
- DSL::_global[:playbooks].each do |play, group|
43
- yield play, group
42
+ DSL::_global[:playbooks].each do |pplay, group|
43
+ yield pplay, group
44
44
  end
45
45
  else
46
46
  yield play, DSL::_global[:playbooks][play]
@@ -64,33 +64,38 @@ module Powerplay
64
64
  puts "PLAYBOOK #{pname} (group=#{Play::clopts[:group]}) -->"
65
65
  groups playbook do |group|
66
66
  tg = nil
67
- thrgroups << (tg = Thread.new {
68
- puts " GROUP #{group.type} (book=#{buch}, cg=#{congroups}) -->"
69
- thrbooks = []
70
- errors = []
71
- group.books.zip(Tmux.pane_ptys) do |book, tty|
72
- tty ||= Tmux.pane_ptys.last
73
- if buch == :all or book.type == buch
74
- puts " BOOK #{book.type}"
75
- apcmd = %|#{PLAYBOOK} #{OPTS} #{book.config[:playbook_directory].first}/#{book.yaml} --extra-vars "#{book.aparams}" >#{tty}|
76
- thrbooks << Thread.new {
77
- std, status = Open3.capture2e apcmd
78
- errors << [book.yaml, apcmd, std] unless status.success?
79
- } unless dryrun
80
- end
81
- end
82
- thrbooks.each{ |t| t.join }
83
- unless errors.empty?
84
- errors.each do |yaml, cmd, txt|
85
- puts '=' * 30
86
- puts ('*' * 10) + ' ' + yaml
87
- puts txt
88
- puts '-' * 30
89
- puts cmd
90
- end
91
- exit 10
92
- end
93
- })
67
+ thrgroups << (tg = Thread.new {
68
+ puts " GROUP #{group.type} (book=#{buch}, cg=#{congroups}) -->"
69
+ thrbooks = []
70
+ errors = []
71
+ group.books.zip(Tmux.pane_ptys) do |book, tty|
72
+ tty ||= Tmux.pane_ptys.last
73
+ if buch == :all or book.type == buch
74
+ puts " BOOK #{book.type}"
75
+ inv = if book.config.member? :inventory
76
+ "-i #{book.config[:inventory].first}"
77
+ else
78
+ ''
79
+ end
80
+ apcmd = %|#{PLAYBOOK} #{OPTS} #{inv} #{book.config[:playbook_directory].first}/#{book.yaml} --extra-vars "#{book.aparams}" >#{tty}|
81
+ thrbooks << Thread.new {
82
+ std, status = Open3.capture2e apcmd
83
+ errors << [book.yaml, apcmd, std] unless status.success?
84
+ } unless dryrun
85
+ end
86
+ end
87
+ thrbooks.each{ |t| t.join }
88
+ unless errors.empty?
89
+ errors.each do |yaml, cmd, txt|
90
+ puts '=' * 30
91
+ puts ('*' * 10) + ' ' + yaml
92
+ puts txt
93
+ puts '-' * 30
94
+ puts cmd
95
+ end
96
+ exit 10
97
+ end
98
+ })
94
99
  # Always wait here unless we're concurrent
95
100
  thrgroups.join unless congroups
96
101
  end
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.6
4
+ version: 0.0.7
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-18 00:00:00.000000000 Z
11
+ date: 2016-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor