bolt 0.20.5 → 0.20.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bolt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/bolt-modules/boltlib/lib/puppet/datatypes/target.rb +1 -1
- data/lib/bolt/analytics.rb +160 -0
- data/lib/bolt/cli.rb +14 -4
- data/lib/bolt/executor.rb +15 -2
- data/lib/bolt/pal.rb +3 -1
- data/lib/bolt/puppetdb/config.rb +9 -4
- data/lib/bolt/transport/local.rb +3 -2
- data/lib/bolt/transport/orch.rb +1 -1
- data/lib/bolt/transport/orch/connection.rb +1 -0
- data/lib/bolt/transport/ssh.rb +7 -2
- data/lib/bolt/transport/ssh/connection.rb +39 -19
- data/lib/bolt/transport/winrm.rb +1 -0
- data/lib/bolt/transport/winrm/connection.rb +3 -0
- data/lib/bolt/util.rb +5 -0
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_ext/puppetdb_inventory.rb +2 -1
- data/vendored/puppet/lib/puppet/defaults.rb +15 -1
- data/vendored/puppet/lib/puppet/pops/loader/static_loader.rb +0 -14
- data/vendored/puppet/lib/puppet/pops/pcore.rb +1 -1
- data/vendored/puppet/lib/puppet/type/file/mode.rb +1 -1
- data/vendored/require_vendored.rb +0 -2
- metadata +3 -21
- data/vendored/puppet/lib/puppet/external/nagios.rb +0 -46
- data/vendored/puppet/lib/puppet/external/nagios/base.rb +0 -472
- data/vendored/puppet/lib/puppet/external/nagios/parser.rb +0 -400
- data/vendored/puppet/lib/puppet/provider/naginator.rb +0 -63
- data/vendored/puppet/lib/puppet/type/nagios_command.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_contact.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_contactgroup.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_host.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_hostdependency.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_hostescalation.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_hostextinfo.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_hostgroup.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_service.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_servicedependency.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_serviceescalation.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_serviceextinfo.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_servicegroup.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_timeperiod.rb +0 -3
- data/vendored/puppet/lib/puppet/util/nagios_maker.rb +0 -85
@@ -1,400 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.4.9
|
4
|
-
# from Racc grammer file "".
|
5
|
-
#
|
6
|
-
|
7
|
-
require 'racc/parser.rb'
|
8
|
-
module Nagios
|
9
|
-
class Parser < Racc::Parser
|
10
|
-
|
11
|
-
module_eval(<<'...end grammar.ry/module_eval...', 'grammar.ry', 50)
|
12
|
-
require 'strscan'
|
13
|
-
|
14
|
-
class ::Nagios::Parser::SyntaxError < RuntimeError; end
|
15
|
-
|
16
|
-
def parse(src)
|
17
|
-
if (RUBY_VERSION < '2.1.0') && src.respond_to?("force_encoding") then
|
18
|
-
src.force_encoding("ASCII-8BIT")
|
19
|
-
end
|
20
|
-
@ss = StringScanner.new(src)
|
21
|
-
|
22
|
-
# state variables
|
23
|
-
@in_parameter_value = false
|
24
|
-
@in_object_definition = false
|
25
|
-
@done = false
|
26
|
-
|
27
|
-
@line = 1
|
28
|
-
@yydebug = true
|
29
|
-
|
30
|
-
do_parse
|
31
|
-
end
|
32
|
-
|
33
|
-
# This tokenizes the outside of object definitions,
|
34
|
-
# and detects when we start defining an object.
|
35
|
-
# We ignore whitespaces, comments and inline comments.
|
36
|
-
# We yield when finding newlines, the "define" keyword,
|
37
|
-
# the object name and the opening curly bracket.
|
38
|
-
def tokenize_outside_definitions
|
39
|
-
case
|
40
|
-
when (chars = @ss.skip(/[ \t]+/)) # ignore whitespace /\s+/
|
41
|
-
;
|
42
|
-
|
43
|
-
when (text = @ss.scan(/\#.*$/)) # ignore comments
|
44
|
-
;
|
45
|
-
|
46
|
-
when (text = @ss.scan(/;.*$/)) # ignore inline comments
|
47
|
-
;
|
48
|
-
|
49
|
-
when (text = @ss.scan(/\n/)) # newline
|
50
|
-
[:RETURN, text]
|
51
|
-
|
52
|
-
when (text = @ss.scan(/\b(define)\b/)) # the "define" keyword
|
53
|
-
[:DEFINE, text]
|
54
|
-
|
55
|
-
when (text = @ss.scan(/[^{ \t\n]+/)) # the name of the object being defined (everything not an opening curly bracket or a separator)
|
56
|
-
[:NAME, text]
|
57
|
-
|
58
|
-
when (text = @ss.scan(/\{/)) # the opening curly bracket - we enter object definition
|
59
|
-
@in_object_definition = true
|
60
|
-
[:LCURLY, text]
|
61
|
-
|
62
|
-
else
|
63
|
-
text = @ss.string[@ss.pos .. -1]
|
64
|
-
raise ScanError, "can not match: '#{text}'"
|
65
|
-
end # case
|
66
|
-
end
|
67
|
-
|
68
|
-
# This tokenizes until we find the parameter name.
|
69
|
-
def tokenize_parameter_name
|
70
|
-
case
|
71
|
-
when (chars = @ss.skip(/[ \t]+/)) # ignore whitespace /\s+/
|
72
|
-
;
|
73
|
-
|
74
|
-
when (text = @ss.scan(/\#.*$/)) # ignore comments
|
75
|
-
;
|
76
|
-
|
77
|
-
when (text = @ss.scan(/;.*$/)) # ignore inline comments
|
78
|
-
;
|
79
|
-
|
80
|
-
when (text = @ss.scan(/\n/)) # newline
|
81
|
-
[:RETURN, text]
|
82
|
-
|
83
|
-
when (text = @ss.scan(/\}/)) # closing curly bracket : end of definition
|
84
|
-
@in_object_definition = false
|
85
|
-
[:RCURLY, text]
|
86
|
-
|
87
|
-
when (not @in_parameter_value and (text = @ss.scan(/\S+/))) # This is the name of the parameter
|
88
|
-
@in_parameter_value = true
|
89
|
-
[:PARAM, text]
|
90
|
-
|
91
|
-
else
|
92
|
-
text = @ss.string[@ss.pos .. -1]
|
93
|
-
raise ScanError, "can not match: '#{text}'"
|
94
|
-
end # case
|
95
|
-
end
|
96
|
-
|
97
|
-
# This tokenizes the parameter value.
|
98
|
-
# There is a special handling for lines containing semicolons :
|
99
|
-
# - unescaped semicolons are line comments (and should stop parsing of the line)
|
100
|
-
# - escaped (with backslash \) semicolons should be kept in the parameter value (without the backslash)
|
101
|
-
def tokenize_parameter_value
|
102
|
-
case
|
103
|
-
when (chars = @ss.skip(/[ \t]+/)) # ignore whitespace /\s+/
|
104
|
-
;
|
105
|
-
|
106
|
-
when (text = @ss.scan(/\#.*$/)) # ignore comments
|
107
|
-
;
|
108
|
-
|
109
|
-
when (text = @ss.scan(/\n/)) # newline
|
110
|
-
@in_parameter_value = false
|
111
|
-
[:RETURN, text]
|
112
|
-
|
113
|
-
when (text = @ss.scan(/.+$/)) # Value of parameter
|
114
|
-
@in_parameter_value = false
|
115
|
-
|
116
|
-
# Special handling of inline comments (;) and escaped semicolons (\;)
|
117
|
-
|
118
|
-
# We split the string on escaped semicolons (\;),
|
119
|
-
# Then we rebuild it as long as there are no inline comments (;)
|
120
|
-
# We join the rebuilt string with unescaped semicolons (on purpose)
|
121
|
-
array = text.split('\;', 0)
|
122
|
-
|
123
|
-
text = ""
|
124
|
-
|
125
|
-
array.each do |elt|
|
126
|
-
|
127
|
-
# Now we split at inline comments. If we have more than 1 element in the array
|
128
|
-
# it means we have an inline comment, so we are able to stop parsing
|
129
|
-
# However we still want to reconstruct the string with its first part (before the comment)
|
130
|
-
linearray = elt.split(';', 0)
|
131
|
-
|
132
|
-
# Let's reconstruct the string with a (unescaped) semicolon
|
133
|
-
if text != "" then
|
134
|
-
text += ';'
|
135
|
-
end
|
136
|
-
text += linearray[0]
|
137
|
-
|
138
|
-
# Now we can stop
|
139
|
-
if linearray.length > 1 then
|
140
|
-
break
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
|
145
|
-
# We strip the text to remove spaces between end of string and beginning of inline comment
|
146
|
-
[:VALUE, text.strip]
|
147
|
-
|
148
|
-
else
|
149
|
-
text = @ss.string[@ss.pos .. -1]
|
150
|
-
raise ScanError, "can not match: '#{text}'"
|
151
|
-
end # case
|
152
|
-
end
|
153
|
-
|
154
|
-
# This tokenizes inside an object definition.
|
155
|
-
# Two cases : parameter name and parameter value
|
156
|
-
def tokenize_inside_definitions
|
157
|
-
if @in_parameter_value
|
158
|
-
tokenize_parameter_value
|
159
|
-
else
|
160
|
-
tokenize_parameter_name
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
# The lexer. Very simple.
|
165
|
-
def token
|
166
|
-
text = @ss.peek(1)
|
167
|
-
@line += 1 if text == "\n"
|
168
|
-
|
169
|
-
token = if @in_object_definition
|
170
|
-
tokenize_inside_definitions
|
171
|
-
else
|
172
|
-
tokenize_outside_definitions
|
173
|
-
end
|
174
|
-
token
|
175
|
-
end
|
176
|
-
|
177
|
-
def next_token
|
178
|
-
return if @ss.eos?
|
179
|
-
|
180
|
-
# skips empty actions
|
181
|
-
until _next_token = token or @ss.eos?; end
|
182
|
-
_next_token
|
183
|
-
end
|
184
|
-
|
185
|
-
def yydebug
|
186
|
-
1
|
187
|
-
end
|
188
|
-
|
189
|
-
def yywrap
|
190
|
-
0
|
191
|
-
end
|
192
|
-
|
193
|
-
def on_error(token, value, vstack )
|
194
|
-
# text = @ss.string[@ss.pos .. -1]
|
195
|
-
text = @ss.peek(20)
|
196
|
-
msg = ""
|
197
|
-
unless value.nil?
|
198
|
-
msg = "line #{@line}: syntax error at value '#{value}' : #{text}"
|
199
|
-
else
|
200
|
-
msg = "line #{@line}: syntax error at token '#{token}' : #{text}"
|
201
|
-
end
|
202
|
-
if @ss.eos?
|
203
|
-
msg = "line #{@line}: Unexpected end of file"
|
204
|
-
end
|
205
|
-
if token == '$end'.intern
|
206
|
-
puts "okay, this is silly"
|
207
|
-
else
|
208
|
-
raise ::Nagios::Parser::SyntaxError, msg
|
209
|
-
end
|
210
|
-
end
|
211
|
-
...end grammar.ry/module_eval...
|
212
|
-
##### State transition tables begin ###
|
213
|
-
|
214
|
-
racc_action_table = [
|
215
|
-
8, 3, 3, 14, 12, 18, 10, 4, 4, 20,
|
216
|
-
12, 14, 12, 9, 6, 12 ]
|
217
|
-
|
218
|
-
racc_action_check = [
|
219
|
-
5, 0, 5, 13, 9, 13, 8, 0, 5, 14,
|
220
|
-
14, 11, 12, 6, 3, 20 ]
|
221
|
-
|
222
|
-
racc_action_pointer = [
|
223
|
-
-1, nil, nil, 11, nil, 0, 8, nil, 6, -4,
|
224
|
-
nil, 7, 4, -1, 2, nil, nil, nil, nil, nil,
|
225
|
-
7, nil ]
|
226
|
-
|
227
|
-
racc_action_default = [
|
228
|
-
-12, -1, -3, -12, -4, -12, -12, -2, -12, -12,
|
229
|
-
22, -12, -10, -12, -12, -6, -11, -7, -5, -9,
|
230
|
-
-12, -8 ]
|
231
|
-
|
232
|
-
racc_goto_table = [
|
233
|
-
11, 1, 15, 16, 17, 19, 7, 13, 5, nil,
|
234
|
-
nil, 21 ]
|
235
|
-
|
236
|
-
racc_goto_check = [
|
237
|
-
4, 2, 6, 4, 6, 4, 2, 5, 1, nil,
|
238
|
-
nil, 4 ]
|
239
|
-
|
240
|
-
racc_goto_pointer = [
|
241
|
-
nil, 8, 1, nil, -9, -4, -9 ]
|
242
|
-
|
243
|
-
racc_goto_default = [
|
244
|
-
nil, nil, nil, 2, nil, nil, nil ]
|
245
|
-
|
246
|
-
racc_reduce_table = [
|
247
|
-
0, 0, :racc_error,
|
248
|
-
1, 10, :_reduce_1,
|
249
|
-
2, 10, :_reduce_2,
|
250
|
-
1, 11, :_reduce_3,
|
251
|
-
1, 11, :_reduce_4,
|
252
|
-
6, 12, :_reduce_5,
|
253
|
-
1, 14, :_reduce_none,
|
254
|
-
2, 14, :_reduce_7,
|
255
|
-
3, 15, :_reduce_8,
|
256
|
-
2, 15, :_reduce_9,
|
257
|
-
1, 13, :_reduce_none,
|
258
|
-
2, 13, :_reduce_none ]
|
259
|
-
|
260
|
-
racc_reduce_n = 12
|
261
|
-
|
262
|
-
racc_shift_n = 22
|
263
|
-
|
264
|
-
racc_token_table = {
|
265
|
-
false => 0,
|
266
|
-
:error => 1,
|
267
|
-
:DEFINE => 2,
|
268
|
-
:NAME => 3,
|
269
|
-
:PARAM => 4,
|
270
|
-
:LCURLY => 5,
|
271
|
-
:RCURLY => 6,
|
272
|
-
:VALUE => 7,
|
273
|
-
:RETURN => 8 }
|
274
|
-
|
275
|
-
racc_nt_base = 9
|
276
|
-
|
277
|
-
racc_use_result_var = true
|
278
|
-
|
279
|
-
Racc_arg = [
|
280
|
-
racc_action_table,
|
281
|
-
racc_action_check,
|
282
|
-
racc_action_default,
|
283
|
-
racc_action_pointer,
|
284
|
-
racc_goto_table,
|
285
|
-
racc_goto_check,
|
286
|
-
racc_goto_default,
|
287
|
-
racc_goto_pointer,
|
288
|
-
racc_nt_base,
|
289
|
-
racc_reduce_table,
|
290
|
-
racc_token_table,
|
291
|
-
racc_shift_n,
|
292
|
-
racc_reduce_n,
|
293
|
-
racc_use_result_var ]
|
294
|
-
|
295
|
-
Racc_token_to_s_table = [
|
296
|
-
"$end",
|
297
|
-
"error",
|
298
|
-
"DEFINE",
|
299
|
-
"NAME",
|
300
|
-
"PARAM",
|
301
|
-
"LCURLY",
|
302
|
-
"RCURLY",
|
303
|
-
"VALUE",
|
304
|
-
"RETURN",
|
305
|
-
"$start",
|
306
|
-
"decls",
|
307
|
-
"decl",
|
308
|
-
"object",
|
309
|
-
"returns",
|
310
|
-
"vars",
|
311
|
-
"var" ]
|
312
|
-
|
313
|
-
Racc_debug_parser = false
|
314
|
-
|
315
|
-
##### State transition tables end #####
|
316
|
-
|
317
|
-
# reduce 0 omitted
|
318
|
-
|
319
|
-
module_eval(<<'.,.,', 'grammar.ry', 6)
|
320
|
-
def _reduce_1(val, _values, result)
|
321
|
-
return val[0] if val[0]
|
322
|
-
result
|
323
|
-
end
|
324
|
-
.,.,
|
325
|
-
|
326
|
-
module_eval(<<'.,.,', 'grammar.ry', 8)
|
327
|
-
def _reduce_2(val, _values, result)
|
328
|
-
if val[1].nil?
|
329
|
-
result = val[0]
|
330
|
-
else
|
331
|
-
if val[0].nil?
|
332
|
-
result = val[1]
|
333
|
-
else
|
334
|
-
result = [ val[0], val[1] ].flatten
|
335
|
-
end
|
336
|
-
end
|
337
|
-
|
338
|
-
result
|
339
|
-
end
|
340
|
-
.,.,
|
341
|
-
|
342
|
-
module_eval(<<'.,.,', 'grammar.ry', 20)
|
343
|
-
def _reduce_3(val, _values, result)
|
344
|
-
result = [val[0]]
|
345
|
-
result
|
346
|
-
end
|
347
|
-
.,.,
|
348
|
-
|
349
|
-
module_eval(<<'.,.,', 'grammar.ry', 21)
|
350
|
-
def _reduce_4(val, _values, result)
|
351
|
-
result = nil
|
352
|
-
result
|
353
|
-
end
|
354
|
-
.,.,
|
355
|
-
|
356
|
-
module_eval(<<'.,.,', 'grammar.ry', 25)
|
357
|
-
def _reduce_5(val, _values, result)
|
358
|
-
result = Nagios::Base.create(val[1],val[4])
|
359
|
-
|
360
|
-
result
|
361
|
-
end
|
362
|
-
.,.,
|
363
|
-
|
364
|
-
# reduce 6 omitted
|
365
|
-
|
366
|
-
module_eval(<<'.,.,', 'grammar.ry', 31)
|
367
|
-
def _reduce_7(val, _values, result)
|
368
|
-
val[1].each {|p,v|
|
369
|
-
val[0][p] = v
|
370
|
-
}
|
371
|
-
result = val[0]
|
372
|
-
|
373
|
-
result
|
374
|
-
end
|
375
|
-
.,.,
|
376
|
-
|
377
|
-
module_eval(<<'.,.,', 'grammar.ry', 38)
|
378
|
-
def _reduce_8(val, _values, result)
|
379
|
-
result = {val[0] => val[1]}
|
380
|
-
result
|
381
|
-
end
|
382
|
-
.,.,
|
383
|
-
|
384
|
-
module_eval(<<'.,.,', 'grammar.ry', 39)
|
385
|
-
def _reduce_9(val, _values, result)
|
386
|
-
result = {val[0] => "" }
|
387
|
-
result
|
388
|
-
end
|
389
|
-
.,.,
|
390
|
-
|
391
|
-
# reduce 10 omitted
|
392
|
-
|
393
|
-
# reduce 11 omitted
|
394
|
-
|
395
|
-
def _reduce_none(val, _values, result)
|
396
|
-
val[0]
|
397
|
-
end
|
398
|
-
|
399
|
-
end # class Parser
|
400
|
-
end # module Nagios
|
@@ -1,63 +0,0 @@
|
|
1
|
-
require 'puppet'
|
2
|
-
require 'puppet/provider/parsedfile'
|
3
|
-
require 'puppet/external/nagios'
|
4
|
-
|
5
|
-
# The base class for all Naginator providers.
|
6
|
-
class Puppet::Provider::Naginator < Puppet::Provider::ParsedFile
|
7
|
-
NAME_STRING = "## --PUPPET_NAME-- (called '_naginator_name' in the manifest)"
|
8
|
-
# Retrieve the associated class from Nagios::Base.
|
9
|
-
def self.nagios_type
|
10
|
-
unless @nagios_type
|
11
|
-
name = resource_type.name.to_s.sub(/^nagios_/, '')
|
12
|
-
unless @nagios_type = Nagios::Base.type(name.to_sym)
|
13
|
-
raise Puppet::DevError, _("Could not find nagios type '%{name}'") % { name: name }
|
14
|
-
end
|
15
|
-
|
16
|
-
# And add our 'ensure' settings, since they aren't a part of
|
17
|
-
# Naginator by default
|
18
|
-
@nagios_type.send(:attr_accessor, :ensure, :target, :on_disk)
|
19
|
-
end
|
20
|
-
@nagios_type
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.parse(text)
|
24
|
-
Nagios::Parser.new.parse(text.gsub(NAME_STRING, "_naginator_name"))
|
25
|
-
rescue => detail
|
26
|
-
raise Puppet::Error, _("Could not parse configuration for %{resource}: %{detail}") % { resource: resource_type.name, detail: detail }, detail.backtrace
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.to_file(records)
|
30
|
-
header + records.collect { |record|
|
31
|
-
# Remap the TYPE_name or _naginator_name params to the
|
32
|
-
# name if the record is a template (register == 0)
|
33
|
-
if record.to_s =~ /register\s+0/
|
34
|
-
record.to_s.sub("_naginator_name", "name").sub(record.type.to_s + "_name", "name")
|
35
|
-
else
|
36
|
-
record.to_s.sub("_naginator_name", NAME_STRING)
|
37
|
-
end
|
38
|
-
}.join("\n")
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.skip_record?(record)
|
42
|
-
false
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.valid_attr?(klass, attr_name)
|
46
|
-
nagios_type.parameters.include?(attr_name)
|
47
|
-
end
|
48
|
-
|
49
|
-
def initialize(resource = nil)
|
50
|
-
if resource.is_a?(Nagios::Base)
|
51
|
-
# We don't use a duplicate here, because some providers (ParsedFile, at least)
|
52
|
-
# use the hash here for later events.
|
53
|
-
@property_hash = resource
|
54
|
-
elsif resource
|
55
|
-
@resource = resource if resource
|
56
|
-
# LAK 2007-05-09: Keep the model stuff around for backward compatibility
|
57
|
-
@model = resource
|
58
|
-
@property_hash = self.class.nagios_type.new
|
59
|
-
else
|
60
|
-
@property_hash = self.class.nagios_type.new
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|