qb 0.1.31 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/exe/qb +8 -5
  3. data/lib/qb.rb +23 -0
  4. data/lib/qb/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c148a94c7547523edbf2258879d61a34316ef84a
4
- data.tar.gz: 446d188612b882cb0f6ce4ef8b670161c6b1734a
3
+ metadata.gz: 0dabe1f38d4dd7b198a3e099bd418da6ad19a639
4
+ data.tar.gz: 10be8427364861c6fd1f81b44f10ab67e18f0d17
5
5
  SHA512:
6
- metadata.gz: 2c6aaac0da8e6c48efb3d507d28b8f4d63b9539d54973c55d0644ea3e690cb5c1fdba83569b80159b8c0fc03791bb234b34d341325d871ebc1b9e7c9e236ce1b
7
- data.tar.gz: 392448a4c0750de37ccab9976c1ce1f0e7e8980d14f3349d80181f108166d759956fcbf157a7de480194ce06ccb9aa9cf5f9bc7145720d40d42e1fe1667f1e29
6
+ metadata.gz: 801af099c750511bb8ba2a54948551063796637a210f00ccdbed367783889a0388ce52bac021a9297094b959ab330590d6532fcea3ce8cb474e70f6978d6af6c
7
+ data.tar.gz: adce8ce876e7c99d63383600302a38cf5fa70e15a19d801101205ccd343ad634e0ebf00abaa15e0394d1ad261e580a05fcad065b3528894ffd921d083b17dc8c
data/exe/qb CHANGED
@@ -125,6 +125,8 @@ def main args
125
125
  set_debug! args
126
126
  debug args: args
127
127
 
128
+ QB.check_ansible_version
129
+
128
130
  role_arg = args.shift
129
131
  debug "role arg" => role_arg
130
132
 
@@ -248,11 +250,12 @@ def main args
248
250
  'vars' => playbook_vars,
249
251
  'pre_tasks' => [
250
252
  # need ansible 2.1.2.0 at least to run
251
- {
252
- 'assert' => {
253
- 'that' => "'ansible 2.1.2' in lookup('pipe', 'ansible --version')",
254
- },
255
- },
253
+ # but this is obviously not flexible enough
254
+ # {
255
+ # 'assert' => {
256
+ # 'that' => "'ansible 2.1.2' in lookup('pipe', 'ansible --version')",
257
+ # },
258
+ # },
256
259
  {
257
260
  'qb_facts' => {
258
261
  'qb_dir' => dir,
data/lib/qb.rb CHANGED
@@ -5,6 +5,7 @@ require "qb/version"
5
5
  module QB
6
6
  ROOT = (Pathname.new(__FILE__).dirname + '..').expand_path
7
7
  ROLES_DIR = ROOT + 'roles'
8
+ MIN_ANSIBLE_VERSION = Gem::Version.new '2.1.2'
8
9
 
9
10
  class Error < StandardError
10
11
  end
@@ -85,6 +86,28 @@ module QB
85
86
  raise "not sure to process '#{ key }' in metea/qb.yml"
86
87
  end
87
88
  end
89
+ end # get_default_dir
90
+
91
+ def self.check_ansible_version
92
+ out = Cmds.out! 'ansible --version'
93
+ version_str = out[/ansible\ ([\d\.]+)/, 1]
94
+
95
+ if version_str.nil?
96
+ raise NRSER.dedent <<-END
97
+ could not parse ansible version from `ansible --version` output:
98
+
99
+ #{ out }
100
+ END
101
+ end
102
+
103
+ version = Gem::Version.new version_str
104
+
105
+ if version < QB::MIN_ANSIBLE_VERSION
106
+ raise NRSER.squish <<-END
107
+ qb #{ QB::VERSION } requires ansible #{ QB::MIN_ANSIBLE_VERSION },
108
+ found version #{ version_str } at #{ `which ansible` }
109
+ END
110
+ end
88
111
  end
89
112
  end
90
113
 
@@ -1,7 +1,7 @@
1
1
  module QB
2
2
  GEM_NAME = 'qb'
3
3
 
4
- VERSION = "0.1.31"
4
+ VERSION = "0.1.32"
5
5
 
6
6
  def self.gemspec
7
7
  Gem.loaded_specs[GEM_NAME]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.31
4
+ version: 0.1.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - nrser
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-27 00:00:00.000000000 Z
11
+ date: 2016-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler