qb 0.1.31 → 0.1.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/qb +8 -5
- data/lib/qb.rb +23 -0
- data/lib/qb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dabe1f38d4dd7b198a3e099bd418da6ad19a639
|
4
|
+
data.tar.gz: 10be8427364861c6fd1f81b44f10ab67e18f0d17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
253
|
-
|
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
|
|
data/lib/qb/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|