openbolt 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Puppetfile +9 -9
- data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +0 -4
- data/lib/bolt/analytics.rb +9 -2
- data/lib/bolt/apply_result.rb +5 -7
- data/lib/bolt/cli.rb +0 -55
- data/lib/bolt/config/options.rb +2 -3
- data/lib/bolt/inventory/group.rb +1 -1
- data/lib/bolt/util.rb +0 -20
- data/lib/bolt/version.rb +1 -1
- data/modules/puppet_connect/plans/test_input_data.pp +2 -2
- metadata +25 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9b0100076081c5483e86b98cea67dc2c9ed0a46ceb7b86d3883257f34b68ee8
|
|
4
|
+
data.tar.gz: c85b0fd26588f95757ebdf25b86ed39a3f2c16dc530b0517c4d4c6848e16440a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 89b8e8179220b89ca34d44682c9a2e83723dfc7d06ffd09ed7bbaff010cb6e4635d837451f9131eea95917151b81c74e6f65912fd77c8cfc8d694e1748f236f9
|
|
7
|
+
data.tar.gz: 6158a6c97dad745b1ad1a0ec9a745bd44ce59f1a8ad0e636c3df2f39cd07f962b28a1a19d6109dc94d68c3938e18cb5acd498ceea12a3fff094327390ab776a8
|
data/Puppetfile
CHANGED
|
@@ -9,7 +9,7 @@ mod 'puppetlabs-service', '3.1.0'
|
|
|
9
9
|
mod 'puppet-openvox_bootstrap', '1.2.0'
|
|
10
10
|
mod 'puppetlabs-facts', '1.7.0'
|
|
11
11
|
|
|
12
|
-
#
|
|
12
|
+
# Other core Puppet modules
|
|
13
13
|
mod 'puppetlabs-inifile', '6.2.0'
|
|
14
14
|
mod 'puppetlabs-apt', '11.1.0'
|
|
15
15
|
mod 'puppetlabs-stdlib', '9.7.0'
|
|
@@ -17,16 +17,16 @@ mod 'puppetlabs-powershell', '6.1.0'
|
|
|
17
17
|
mod 'puppetlabs-pwshlib', '2.0.0'
|
|
18
18
|
|
|
19
19
|
# Core types and providers for Puppet 6
|
|
20
|
-
mod 'puppetlabs-augeas_core', '
|
|
21
|
-
mod 'puppetlabs-host_core', '
|
|
20
|
+
mod 'puppetlabs-augeas_core', '2.0.1'
|
|
21
|
+
mod 'puppetlabs-host_core', '2.0.1'
|
|
22
22
|
mod 'puppetlabs-scheduled_task', '4.0.3'
|
|
23
|
-
mod 'puppetlabs-sshkeys_core', '
|
|
23
|
+
mod 'puppetlabs-sshkeys_core', '3.0.1'
|
|
24
24
|
mod 'puppetlabs-zfs_core', '1.6.1'
|
|
25
|
-
mod 'puppetlabs-cron_core', '
|
|
26
|
-
mod 'puppetlabs-mount_core', '
|
|
27
|
-
mod 'puppetlabs-selinux_core', '
|
|
28
|
-
mod 'puppetlabs-yumrepo_core', '
|
|
29
|
-
mod 'puppetlabs-zone_core', '
|
|
25
|
+
mod 'puppetlabs-cron_core', '2.0.2'
|
|
26
|
+
mod 'puppetlabs-mount_core', '2.0.1'
|
|
27
|
+
mod 'puppetlabs-selinux_core', '2.0.1'
|
|
28
|
+
mod 'puppetlabs-yumrepo_core', '3.0.1'
|
|
29
|
+
mod 'puppetlabs-zone_core', '2.0.1'
|
|
30
30
|
|
|
31
31
|
# Useful additional modules
|
|
32
32
|
mod 'puppetlabs-package', '3.1.0'
|
|
@@ -5,7 +5,6 @@ require 'bolt/error'
|
|
|
5
5
|
# Makes a query to [puppetdb](https://puppet.com/docs/puppetdb/latest/index.html)
|
|
6
6
|
# using Bolt's PuppetDB client.
|
|
7
7
|
Puppet::Functions.create_function(:puppetdb_query) do
|
|
8
|
-
# rubocop:disable Layout/LineLength
|
|
9
8
|
# Make a query to PuppetDB.
|
|
10
9
|
#
|
|
11
10
|
# @param query A PQL query.
|
|
@@ -13,13 +12,11 @@ Puppet::Functions.create_function(:puppetdb_query) do
|
|
|
13
12
|
# @return Results of the PuppetDB query.
|
|
14
13
|
# @example Request certnames for all nodes
|
|
15
14
|
# puppetdb_query('nodes[certname] {}')
|
|
16
|
-
# rubocop:enable Layout/LineLength
|
|
17
15
|
dispatch :make_query do
|
|
18
16
|
param 'Variant[String, Array[Data]]', :query
|
|
19
17
|
return_type 'Array[Data]'
|
|
20
18
|
end
|
|
21
19
|
|
|
22
|
-
# rubocop:disable Layout/LineLength
|
|
23
20
|
# Make a query to a named PuppetDB instance.
|
|
24
21
|
#
|
|
25
22
|
# @param query A PQL query.
|
|
@@ -28,7 +25,6 @@ Puppet::Functions.create_function(:puppetdb_query) do
|
|
|
28
25
|
# @return Results of the PuppetDB query.
|
|
29
26
|
# @example Request certnames for all nodes using a named PuppetDB instance
|
|
30
27
|
# puppetdb_query('nodes[certname] {}', 'instance-1')
|
|
31
|
-
# rubocop:enable Layout/LineLength
|
|
32
28
|
dispatch :make_query_with_instance do
|
|
33
29
|
param 'Variant[String, Array[Data]]', :query
|
|
34
30
|
param 'String', :instance
|
data/lib/bolt/analytics.rb
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# None of this currently works, as it's based on Perforce's old GA setup.
|
|
4
|
+
# It is functionally disabled here, but the code remains in case we want
|
|
5
|
+
# to revive it for Vox Pupuli later.
|
|
3
6
|
require_relative '../bolt/util'
|
|
4
7
|
require_relative '../bolt/version'
|
|
5
8
|
require 'find'
|
|
@@ -30,6 +33,8 @@ module Bolt
|
|
|
30
33
|
}.freeze
|
|
31
34
|
|
|
32
35
|
def self.build_client(enabled = true)
|
|
36
|
+
# Remove if we fix this for Vox analytics
|
|
37
|
+
config = { 'disabled' => true }
|
|
33
38
|
begin
|
|
34
39
|
config_file = config_path
|
|
35
40
|
config = enabled ? load_config(config_file) : {}
|
|
@@ -38,7 +43,8 @@ module Bolt
|
|
|
38
43
|
end
|
|
39
44
|
|
|
40
45
|
if !enabled || config['disabled'] || ENV['BOLT_DISABLE_ANALYTICS']
|
|
41
|
-
|
|
46
|
+
# Uncomment if we fix this for Vox analytics
|
|
47
|
+
# Bolt::Logger.debug "Analytics opt-out is set, analytics will be disabled"
|
|
42
48
|
NoopClient.new
|
|
43
49
|
else
|
|
44
50
|
unless config.key?('user-id')
|
|
@@ -76,7 +82,8 @@ module Bolt
|
|
|
76
82
|
if File.exist?(filename)
|
|
77
83
|
Bolt::Util.read_optional_yaml_hash(filename, 'analytics')
|
|
78
84
|
else
|
|
79
|
-
|
|
85
|
+
# Remove || true if we fix this for Vox analytics
|
|
86
|
+
unless ENV['BOLT_DISABLE_ANALYTICS'] || true
|
|
80
87
|
msg = <<~ANALYTICS
|
|
81
88
|
Bolt collects data about how you use it. You can opt out of providing this data.
|
|
82
89
|
To learn how to disable data collection, or see what data Bolt collects and why,
|
data/lib/bolt/apply_result.rb
CHANGED
|
@@ -52,13 +52,11 @@ module Bolt
|
|
|
52
52
|
missing_keys = expected_report_keys.reject { |k| result.value.include?(k) }
|
|
53
53
|
|
|
54
54
|
unless missing_keys.empty?
|
|
55
|
-
if result['_output']
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
msg = "Report did not contain all expected keys missing: #{missing_keys.join(', ')}"
|
|
61
|
-
end
|
|
55
|
+
msg = if result['_output']
|
|
56
|
+
"Report result contains an '_output' key. Catalog application might have printed extraneous output to stdout: #{result['_output']}"
|
|
57
|
+
else
|
|
58
|
+
"Report did not contain all expected keys missing: #{missing_keys.join(', ')}"
|
|
59
|
+
end
|
|
62
60
|
|
|
63
61
|
{ 'msg' => msg,
|
|
64
62
|
'kind' => 'bolt/invalid-report' }
|
data/lib/bolt/cli.rb
CHANGED
|
@@ -106,15 +106,6 @@ module Bolt
|
|
|
106
106
|
# help text
|
|
107
107
|
options[:subcommand] = nil unless COMMANDS.include?(options[:subcommand])
|
|
108
108
|
|
|
109
|
-
if Bolt::Util.first_run?
|
|
110
|
-
FileUtils.touch(Bolt::Util.first_runs_free)
|
|
111
|
-
|
|
112
|
-
if options[:subcommand].nil? && $stdout.isatty
|
|
113
|
-
welcome_message
|
|
114
|
-
raise Bolt::CLIExit
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
|
|
118
109
|
# Update the parser for the subcommand (or lack thereof)
|
|
119
110
|
parser.update
|
|
120
111
|
puts parser.help
|
|
@@ -165,52 +156,6 @@ module Bolt
|
|
|
165
156
|
end
|
|
166
157
|
end
|
|
167
158
|
|
|
168
|
-
# TODO: Move this to the parser.
|
|
169
|
-
#
|
|
170
|
-
# Print a welcome message when users first install Bolt and run `bolt`,
|
|
171
|
-
# `bolt help` or `bolt --help`.
|
|
172
|
-
#
|
|
173
|
-
private def welcome_message
|
|
174
|
-
bolt = <<~BOLT
|
|
175
|
-
`.::-`
|
|
176
|
-
`.-:///////-.`
|
|
177
|
-
`-:////:. `-:///:- /ooo. .ooo/
|
|
178
|
-
`.-:///::///:-` `-//: ymmm- :mmmy .---.
|
|
179
|
-
:///:-. `.:////. -//: ymmm- :mmmy +mmm+
|
|
180
|
-
://. ///. -//: ymmm--/++/- `-/++/:` :mmmy-:smmms::-
|
|
181
|
-
://. ://. .://: ymmmdmmmmmmdo` .smmmmmmmmh: :mmmysmmmmmmmms
|
|
182
|
-
://. ://:///:-. ymmmh/--/hmmmy -mmmd/-.:hmmm+:mmmy.-smmms--.
|
|
183
|
-
://:.` .-////:-` ymmm- ymmm:hmmm- `dmmm/mmmy +mmm+
|
|
184
|
-
`-:///:-..:///:-.` ymmm- ommm/dmmm` hmmm+mmmy +mmm+
|
|
185
|
-
`.-:////:-` ymmm+ /mmmm.ommms` /mmmh:mmmy +mmmo
|
|
186
|
-
`-.` ymmmmmhhmmmmd: ommmmhydmmmy`:mmmy -mmmmdhd
|
|
187
|
-
oyyy+shddhs/` .+shddhy+- -yyyo .ohddhs
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
BOLT
|
|
191
|
-
example_cmd = if Bolt::Util.windows?
|
|
192
|
-
"Invoke-BoltCommand -Command 'hostname' -Targets localhost"
|
|
193
|
-
else
|
|
194
|
-
"bolt command run 'hostname' --target localhost"
|
|
195
|
-
end
|
|
196
|
-
prev_cmd = String.new("bolt")
|
|
197
|
-
prev_cmd << " #{@argv[0]}" unless @argv.empty?
|
|
198
|
-
|
|
199
|
-
message = <<~MSG
|
|
200
|
-
🎉 Welcome to OpenBolt #{VERSION}
|
|
201
|
-
😌 We're here to help bring order to the chaos
|
|
202
|
-
📖 Find our documentation at https://bolt.guide
|
|
203
|
-
🙋 Ask a question in #bolt on https://slack.puppet.com/
|
|
204
|
-
🔩 Contribute at https://github.com/puppetlabs/bolt/
|
|
205
|
-
💡 Not sure where to start? Try "#{example_cmd}"
|
|
206
|
-
|
|
207
|
-
We only print this message once. Run "#{prev_cmd}" again for help text.
|
|
208
|
-
MSG
|
|
209
|
-
|
|
210
|
-
$stdout.print "\033[36m#{bolt}\033[0m"
|
|
211
|
-
$stdout.print message
|
|
212
|
-
end
|
|
213
|
-
|
|
214
159
|
# TODO: Move this to the parser.
|
|
215
160
|
#
|
|
216
161
|
# Validate the command. Ensure that the subcommand and action are
|
data/lib/bolt/config/options.rb
CHANGED
|
@@ -428,15 +428,14 @@ module Bolt
|
|
|
428
428
|
_example: ["myproject", "myproject::foo", "myproject::bar", "myproject::deploy::*"]
|
|
429
429
|
},
|
|
430
430
|
"plugin-hooks" => {
|
|
431
|
-
# rubocop:disable Layout/LineLength
|
|
432
431
|
description: "A map of [plugin hooks](writing_plugins.md#hooks) and which plugins a hook should use. " \
|
|
433
432
|
"The only configurable plugin hook is `puppet_library`, which can use two possible plugins: " \
|
|
434
433
|
"[`openvox_bootstrap`](https://github.com/voxpupuli/puppet-openvox_bootstrap#openvox_boostrapinstall) " \
|
|
435
434
|
"and [`task`](using_plugins.md#task).",
|
|
436
|
-
# rubocop:enable Layout/LineLength
|
|
437
435
|
type: Hash,
|
|
438
436
|
_plugin: true,
|
|
439
|
-
_example: { "puppet_library" => { "plugin" => "
|
|
437
|
+
_example: { "puppet_library" => { "plugin" => "openvox_bootstrap", "version" => "1.2.0",
|
|
438
|
+
"_run_as" => "root" } }
|
|
440
439
|
},
|
|
441
440
|
"plugins" => {
|
|
442
441
|
description: "A map of plugins and their configuration data, where each key is the name of a plugin and " \
|
data/lib/bolt/inventory/group.rb
CHANGED
|
@@ -256,7 +256,7 @@ module Bolt
|
|
|
256
256
|
|
|
257
257
|
# DEPRECATION : remove this before finalization
|
|
258
258
|
if input.key?('target-lookups')
|
|
259
|
-
msg = "'target-lookups' are no longer a separate key. Merge 'target-lookups' and 'targets' lists and replace 'plugin' with '_plugin'"
|
|
259
|
+
msg = "'target-lookups' are no longer a separate key. Merge 'target-lookups' and 'targets' lists and replace 'plugin' with '_plugin'"
|
|
260
260
|
raise ValidationError.new(msg, @name)
|
|
261
261
|
end
|
|
262
262
|
|
data/lib/bolt/util.rb
CHANGED
|
@@ -80,26 +80,6 @@ module Bolt
|
|
|
80
80
|
File.exist?(path) ? read_yaml_hash(path, file_name) : {}
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
-
def first_runs_free
|
|
84
|
-
# If this fails, use the system path instead
|
|
85
|
-
FileUtils.mkdir_p(Bolt::Config.user_path)
|
|
86
|
-
Bolt::Config.user_path + '.first_runs_free'
|
|
87
|
-
rescue StandardError
|
|
88
|
-
begin
|
|
89
|
-
# If using the system path fails, then don't bother with the welcome
|
|
90
|
-
# message
|
|
91
|
-
FileUtils.mkdir_p(Bolt::Config.system_path)
|
|
92
|
-
Bolt::Config.system_path + '.first_runs_free'
|
|
93
|
-
rescue StandardError
|
|
94
|
-
nil
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def first_run?
|
|
99
|
-
!first_runs_free.nil? &&
|
|
100
|
-
!File.exist?(first_runs_free)
|
|
101
|
-
end
|
|
102
|
-
|
|
103
83
|
# If Puppet is loaded, we aleady have the path to the module and should
|
|
104
84
|
# just get it. This takes the path to a file provided by the user and a
|
|
105
85
|
# Puppet Parser scope object and tries to find the file, either as an
|
data/lib/bolt/version.rb
CHANGED
|
@@ -78,11 +78,11 @@ plan puppet_connect::test_input_data(TargetSpec $targets = 'all') {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
#
|
|
81
|
+
# OpenBolt defaults to using the "module" based form of the openvox_bootstrap plugin. Connect defaults
|
|
82
82
|
# to using the "task" based form as *only* the task based form in supported in Connect. This check
|
|
83
83
|
# ensures that if the default is not being used, only task based plugins are allowed.
|
|
84
84
|
$plugin = $target.plugin_hooks["puppet_library"]
|
|
85
|
-
$user_configured_plugin = $plugin != { "plugin"=> "
|
|
85
|
+
$user_configured_plugin = $plugin != { "plugin"=> "openvox_bootstrap", "stop_service"=> true }
|
|
86
86
|
if ($user_configured_plugin and $plugin["plugin"] != "task"){
|
|
87
87
|
fail_plan("Only task plugins are acceptable for puppet_library hook")
|
|
88
88
|
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openbolt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenVox Project
|
|
@@ -111,14 +111,14 @@ dependencies:
|
|
|
111
111
|
requirements:
|
|
112
112
|
- - "~>"
|
|
113
113
|
- !ruby/object:Gem::Version
|
|
114
|
-
version: '2.
|
|
114
|
+
version: '2.6'
|
|
115
115
|
type: :runtime
|
|
116
116
|
prerelease: false
|
|
117
117
|
version_requirements: !ruby/object:Gem::Requirement
|
|
118
118
|
requirements:
|
|
119
119
|
- - "~>"
|
|
120
120
|
- !ruby/object:Gem::Version
|
|
121
|
-
version: '2.
|
|
121
|
+
version: '2.6'
|
|
122
122
|
- !ruby/object:Gem::Dependency
|
|
123
123
|
name: jwt
|
|
124
124
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -147,6 +147,26 @@ dependencies:
|
|
|
147
147
|
- - "~>"
|
|
148
148
|
- !ruby/object:Gem::Version
|
|
149
149
|
version: '2.2'
|
|
150
|
+
- !ruby/object:Gem::Dependency
|
|
151
|
+
name: minitar
|
|
152
|
+
requirement: !ruby/object:Gem::Requirement
|
|
153
|
+
requirements:
|
|
154
|
+
- - ">="
|
|
155
|
+
- !ruby/object:Gem::Version
|
|
156
|
+
version: '0.6'
|
|
157
|
+
- - "<"
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: '2.0'
|
|
160
|
+
type: :runtime
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - ">="
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: '0.6'
|
|
167
|
+
- - "<"
|
|
168
|
+
- !ruby/object:Gem::Version
|
|
169
|
+
version: '2.0'
|
|
150
170
|
- !ruby/object:Gem::Dependency
|
|
151
171
|
name: net-scp
|
|
152
172
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -307,14 +327,14 @@ dependencies:
|
|
|
307
327
|
name: terminal-table
|
|
308
328
|
requirement: !ruby/object:Gem::Requirement
|
|
309
329
|
requirements:
|
|
310
|
-
- - "
|
|
330
|
+
- - ">="
|
|
311
331
|
- !ruby/object:Gem::Version
|
|
312
332
|
version: '3.0'
|
|
313
333
|
type: :runtime
|
|
314
334
|
prerelease: false
|
|
315
335
|
version_requirements: !ruby/object:Gem::Requirement
|
|
316
336
|
requirements:
|
|
317
|
-
- - "
|
|
337
|
+
- - ">="
|
|
318
338
|
- !ruby/object:Gem::Version
|
|
319
339
|
version: '3.0'
|
|
320
340
|
- !ruby/object:Gem::Dependency
|
|
@@ -433,26 +453,6 @@ dependencies:
|
|
|
433
453
|
- - "~>"
|
|
434
454
|
- !ruby/object:Gem::Version
|
|
435
455
|
version: 5.0.0
|
|
436
|
-
- !ruby/object:Gem::Dependency
|
|
437
|
-
name: minitar
|
|
438
|
-
requirement: !ruby/object:Gem::Requirement
|
|
439
|
-
requirements:
|
|
440
|
-
- - ">="
|
|
441
|
-
- !ruby/object:Gem::Version
|
|
442
|
-
version: '0.6'
|
|
443
|
-
- - "<"
|
|
444
|
-
- !ruby/object:Gem::Version
|
|
445
|
-
version: '2.0'
|
|
446
|
-
type: :runtime
|
|
447
|
-
prerelease: false
|
|
448
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
449
|
-
requirements:
|
|
450
|
-
- - ">="
|
|
451
|
-
- !ruby/object:Gem::Version
|
|
452
|
-
version: '0.6'
|
|
453
|
-
- - "<"
|
|
454
|
-
- !ruby/object:Gem::Version
|
|
455
|
-
version: '2.0'
|
|
456
456
|
description: Execute commands remotely over SSH and WinRM
|
|
457
457
|
email:
|
|
458
458
|
- openvox@voxpupuli.org
|