bolt 2.40.1 → 3.0.1
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/Puppetfile +17 -17
- data/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb +25 -0
- data/bolt-modules/boltlib/lib/puppet/functions/parallelize.rb +6 -8
- data/bolt-modules/boltlib/lib/puppet/functions/wait_until_available.rb +7 -3
- data/lib/bolt/analytics.rb +3 -2
- data/lib/bolt/applicator.rb +11 -1
- data/lib/bolt/bolt_option_parser.rb +3 -113
- data/lib/bolt/catalog.rb +10 -29
- data/lib/bolt/cli.rb +58 -157
- data/lib/bolt/config.rb +62 -239
- data/lib/bolt/config/options.rb +58 -97
- data/lib/bolt/config/transport/local.rb +1 -0
- data/lib/bolt/config/transport/options.rb +8 -1
- data/lib/bolt/config/transport/orch.rb +1 -0
- data/lib/bolt/executor.rb +15 -5
- data/lib/bolt/inventory.rb +3 -2
- data/lib/bolt/inventory/group.rb +35 -4
- data/lib/bolt/inventory/inventory.rb +1 -1
- data/lib/bolt/logger.rb +115 -11
- data/lib/bolt/module.rb +10 -2
- data/lib/bolt/module_installer.rb +4 -2
- data/lib/bolt/module_installer/resolver.rb +65 -12
- data/lib/bolt/module_installer/specs/forge_spec.rb +8 -2
- data/lib/bolt/module_installer/specs/git_spec.rb +17 -2
- data/lib/bolt/outputter/human.rb +9 -5
- data/lib/bolt/outputter/json.rb +16 -16
- data/lib/bolt/outputter/rainbow.rb +3 -3
- data/lib/bolt/pal.rb +93 -14
- data/lib/bolt/pal/yaml_plan.rb +8 -2
- data/lib/bolt/pal/yaml_plan/evaluator.rb +7 -19
- data/lib/bolt/pal/yaml_plan/step.rb +3 -24
- data/lib/bolt/pal/yaml_plan/step/upload.rb +2 -2
- data/lib/bolt/pal/yaml_plan/transpiler.rb +6 -1
- data/lib/bolt/plugin.rb +3 -3
- data/lib/bolt/plugin/cache.rb +7 -7
- data/lib/bolt/plugin/module.rb +0 -23
- data/lib/bolt/plugin/puppet_connect_data.rb +77 -0
- data/lib/bolt/plugin/puppetdb.rb +1 -1
- data/lib/bolt/project.rb +54 -81
- data/lib/bolt/project_manager.rb +4 -3
- data/lib/bolt/project_manager/module_migrator.rb +6 -5
- data/lib/bolt/rerun.rb +1 -1
- data/lib/bolt/shell/bash.rb +1 -1
- data/lib/bolt/shell/bash/tmpdir.rb +4 -1
- data/lib/bolt/shell/powershell.rb +3 -4
- data/lib/bolt/shell/powershell/snippets.rb +9 -149
- data/lib/bolt/task.rb +1 -1
- data/lib/bolt/transport/docker/connection.rb +2 -2
- data/lib/bolt/transport/local.rb +1 -9
- data/lib/bolt/transport/orch/connection.rb +1 -1
- data/lib/bolt/transport/ssh.rb +1 -2
- data/lib/bolt/transport/ssh/connection.rb +1 -1
- data/lib/bolt/validator.rb +2 -2
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_server/config.rb +1 -1
- data/lib/bolt_server/schemas/partials/task.json +1 -1
- data/lib/bolt_server/transport_app.rb +3 -2
- data/libexec/bolt_catalog +1 -1
- data/modules/aggregate/plans/count.pp +21 -0
- data/modules/aggregate/plans/targets.pp +21 -0
- data/modules/puppet_connect/plans/test_input_data.pp +31 -0
- data/modules/puppetdb_fact/plans/init.pp +10 -0
- metadata +27 -18
- data/modules/aggregate/plans/nodes.pp +0 -36
@@ -70,12 +70,17 @@ module Bolt
|
|
70
70
|
def ps_task(path, arguments)
|
71
71
|
<<~PS
|
72
72
|
$private:tempArgs = Get-ContentAsJson (
|
73
|
-
|
73
|
+
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('#{Base64.encode64(JSON.dump(arguments))}'))
|
74
74
|
)
|
75
75
|
$allowedArgs = (Get-Command "#{path}").Parameters.Keys
|
76
76
|
$private:taskArgs = @{}
|
77
77
|
$private:tempArgs.Keys | ? { $allowedArgs -contains $_ } | % { $private:taskArgs[$_] = $private:tempArgs[$_] }
|
78
|
-
try {
|
78
|
+
try {
|
79
|
+
& "#{path}" @taskArgs
|
80
|
+
} catch {
|
81
|
+
$Host.UI.WriteErrorLine("[$($_.FullyQualifiedErrorId)] Exception $($_.InvocationInfo.PositionMessage).`n$($_.Exception.Message)");
|
82
|
+
exit 1;
|
83
|
+
}
|
79
84
|
PS
|
80
85
|
end
|
81
86
|
|
@@ -102,151 +107,11 @@ module Bolt
|
|
102
107
|
"${boltBaseDir}\\hiera\\lib;" +
|
103
108
|
$ENV:RUBYLIB
|
104
109
|
|
105
|
-
Add-Type -AssemblyName System.ServiceModel.Web, System.Runtime.Serialization
|
106
|
-
$utf8 = [System.Text.Encoding]::UTF8
|
107
|
-
|
108
|
-
function Write-Stream {
|
109
|
-
PARAM(
|
110
|
-
[Parameter(Position=0)] $stream,
|
111
|
-
[Parameter(ValueFromPipeline=$true)] $string
|
112
|
-
)
|
113
|
-
PROCESS {
|
114
|
-
$bytes = $utf8.GetBytes($string)
|
115
|
-
$stream.Write( $bytes, 0, $bytes.Length )
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
function Convert-JsonToXml {
|
120
|
-
PARAM([Parameter(ValueFromPipeline=$true)] [string[]] $json)
|
121
|
-
BEGIN {
|
122
|
-
$mStream = New-Object System.IO.MemoryStream
|
123
|
-
}
|
124
|
-
PROCESS {
|
125
|
-
$json | Write-Stream -Stream $mStream
|
126
|
-
}
|
127
|
-
END {
|
128
|
-
$mStream.Position = 0
|
129
|
-
try {
|
130
|
-
$jsonReader = [System.Runtime.Serialization.Json.JsonReaderWriterFactory]::CreateJsonReader($mStream,[System.Xml.XmlDictionaryReaderQuotas]::Max)
|
131
|
-
$xml = New-Object Xml.XmlDocument
|
132
|
-
$xml.Load($jsonReader)
|
133
|
-
$xml
|
134
|
-
} finally {
|
135
|
-
$jsonReader.Close()
|
136
|
-
$mStream.Dispose()
|
137
|
-
}
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
Function ConvertFrom-Xml {
|
142
|
-
[CmdletBinding(DefaultParameterSetName="AutoType")]
|
143
|
-
PARAM(
|
144
|
-
[Parameter(ValueFromPipeline=$true,Mandatory=$true,Position=1)] [Xml.XmlNode] $xml,
|
145
|
-
[Parameter(Mandatory=$true,ParameterSetName="ManualType")] [Type] $Type,
|
146
|
-
[Switch] $ForceType
|
147
|
-
)
|
148
|
-
PROCESS{
|
149
|
-
if (Get-Member -InputObject $xml -Name root) {
|
150
|
-
return $xml.root.Objects | ConvertFrom-Xml
|
151
|
-
} elseif (Get-Member -InputObject $xml -Name Objects) {
|
152
|
-
return $xml.Objects | ConvertFrom-Xml
|
153
|
-
}
|
154
|
-
$propbag = @{}
|
155
|
-
foreach ($name in Get-Member -InputObject $xml -MemberType Properties | Where-Object{$_.Name -notmatch "^(__.*|type)$"} | Select-Object -ExpandProperty name) {
|
156
|
-
Write-Debug "$Name Type: $($xml.$Name.type)" -Debug:$false
|
157
|
-
$propbag."$Name" = Convert-Properties $xml."$name"
|
158
|
-
}
|
159
|
-
if (!$Type -and $xml.HasAttribute("__type")) { $Type = $xml.__Type }
|
160
|
-
if ($ForceType -and $Type) {
|
161
|
-
try {
|
162
|
-
$output = New-Object $Type -Property $propbag
|
163
|
-
} catch {
|
164
|
-
$output = New-Object PSObject -Property $propbag
|
165
|
-
$output.PsTypeNames.Insert(0, $xml.__type)
|
166
|
-
}
|
167
|
-
} elseif ($propbag.Count -ne 0) {
|
168
|
-
$output = New-Object PSObject -Property $propbag
|
169
|
-
if ($Type) {
|
170
|
-
$output.PsTypeNames.Insert(0, $Type)
|
171
|
-
}
|
172
|
-
}
|
173
|
-
return $output
|
174
|
-
}
|
175
|
-
}
|
176
|
-
|
177
|
-
Function Convert-Properties {
|
178
|
-
PARAM($InputObject)
|
179
|
-
switch ($InputObject.type) {
|
180
|
-
"object" {
|
181
|
-
return (ConvertFrom-Xml -Xml $InputObject)
|
182
|
-
}
|
183
|
-
"string" {
|
184
|
-
$MightBeADate = $InputObject.get_InnerText() -as [DateTime]
|
185
|
-
## Strings that are actually dates (*grumble* JSON is crap)
|
186
|
-
if ($MightBeADate -and $propbag."$Name" -eq $MightBeADate.ToString("G")) {
|
187
|
-
return $MightBeADate
|
188
|
-
} else {
|
189
|
-
return $InputObject.get_InnerText()
|
190
|
-
}
|
191
|
-
}
|
192
|
-
"number" {
|
193
|
-
$number = $InputObject.get_InnerText()
|
194
|
-
if ($number -eq ($number -as [int])) {
|
195
|
-
return $number -as [int]
|
196
|
-
} elseif ($number -eq ($number -as [double])) {
|
197
|
-
return $number -as [double]
|
198
|
-
} else {
|
199
|
-
return $number -as [decimal]
|
200
|
-
}
|
201
|
-
}
|
202
|
-
"boolean" {
|
203
|
-
return [bool]::parse($InputObject.get_InnerText())
|
204
|
-
}
|
205
|
-
"null" {
|
206
|
-
return $null
|
207
|
-
}
|
208
|
-
"array" {
|
209
|
-
[object[]]$Items = $(foreach( $item in $InputObject.GetEnumerator() ) {
|
210
|
-
Convert-Properties $item
|
211
|
-
})
|
212
|
-
return $Items
|
213
|
-
}
|
214
|
-
default {
|
215
|
-
return $InputObject
|
216
|
-
}
|
217
|
-
}
|
218
|
-
}
|
219
|
-
|
220
|
-
Function ConvertFrom-Json2 {
|
221
|
-
[CmdletBinding()]
|
222
|
-
PARAM(
|
223
|
-
[Parameter(ValueFromPipeline=$true,Mandatory=$true,Position=1)] [string] $InputObject,
|
224
|
-
[Parameter(Mandatory=$true)] [Type] $Type,
|
225
|
-
[Switch] $ForceType
|
226
|
-
)
|
227
|
-
PROCESS {
|
228
|
-
$null = $PSBoundParameters.Remove("InputObject")
|
229
|
-
[Xml.XmlElement]$xml = (Convert-JsonToXml $InputObject).Root
|
230
|
-
if ($xml) {
|
231
|
-
if ($xml.Objects) {
|
232
|
-
$xml.Objects.Item.GetEnumerator() | ConvertFrom-Xml @PSBoundParameters
|
233
|
-
} elseif ($xml.Item -and $xml.Item -isnot [System.Management.Automation.PSParameterizedProperty]) {
|
234
|
-
$xml.Item | ConvertFrom-Xml @PSBoundParameters
|
235
|
-
} else {
|
236
|
-
$xml | ConvertFrom-Xml @PSBoundParameters
|
237
|
-
}
|
238
|
-
} else {
|
239
|
-
Write-Error "Failed to parse JSON with JsonReader" -Debug:$false
|
240
|
-
}
|
241
|
-
}
|
242
|
-
}
|
243
|
-
|
244
110
|
function ConvertFrom-PSCustomObject
|
245
111
|
{
|
246
112
|
PARAM([Parameter(ValueFromPipeline = $true)] $InputObject)
|
247
113
|
PROCESS {
|
248
114
|
if ($null -eq $InputObject) { return $null }
|
249
|
-
|
250
115
|
if ($InputObject -is [System.Collections.IEnumerable] -and $InputObject -isnot [string]) {
|
251
116
|
$collection = @(
|
252
117
|
foreach ($object in $InputObject) { ConvertFrom-PSCustomObject $object }
|
@@ -273,13 +138,8 @@ module Bolt
|
|
273
138
|
[Parameter(Mandatory = $true)] $Text,
|
274
139
|
[Parameter(Mandatory = $false)] [Text.Encoding] $Encoding = [Text.Encoding]::UTF8
|
275
140
|
)
|
276
|
-
|
277
|
-
|
278
|
-
if ($PSVersionTable.PSVersion -lt [Version]'3.0') {
|
279
|
-
$Text | ConvertFrom-Json2 -Type PSObject | ConvertFrom-PSCustomObject
|
280
|
-
} else {
|
281
|
-
$Text | ConvertFrom-Json | ConvertFrom-PSCustomObject
|
282
|
-
}
|
141
|
+
|
142
|
+
$Text | ConvertFrom-Json | ConvertFrom-PSCustomObject
|
283
143
|
}
|
284
144
|
PS
|
285
145
|
end
|
data/lib/bolt/task.rb
CHANGED
@@ -149,7 +149,7 @@ module Bolt
|
|
149
149
|
if unknown_keys.any?
|
150
150
|
msg = "Metadata for task '#{@name}' contains unknown keys: #{unknown_keys.join(', ')}."
|
151
151
|
msg += " This could be a typo in the task metadata or may result in incorrect behavior."
|
152
|
-
|
152
|
+
Bolt::Logger.warn("unknown_task_metadata_keys", msg)
|
153
153
|
end
|
154
154
|
end
|
155
155
|
end
|
@@ -140,10 +140,10 @@ module Bolt
|
|
140
140
|
if @target.options['cleanup']
|
141
141
|
_, stderr, exitcode = execute('rm', '-rf', dir, {})
|
142
142
|
if exitcode != 0
|
143
|
-
|
143
|
+
Bolt::Logger.warn("fail_cleanup", "Failed to clean up tmpdir '#{dir}': #{stderr}")
|
144
144
|
end
|
145
145
|
else
|
146
|
-
|
146
|
+
Bolt::Logger.warn("skip_cleanup", "Skipping cleanup of tmpdir '#{dir}'")
|
147
147
|
end
|
148
148
|
end
|
149
149
|
end
|
data/lib/bolt/transport/local.rb
CHANGED
@@ -11,18 +11,10 @@ module Bolt
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def with_connection(target)
|
14
|
-
if target.transport_config['bundled-ruby']
|
14
|
+
if target.transport_config['bundled-ruby']
|
15
15
|
target.set_local_defaults
|
16
16
|
end
|
17
17
|
|
18
|
-
if target.name != 'localhost' &&
|
19
|
-
!target.transport_config.key?('bundled-ruby')
|
20
|
-
msg = "The local transport will default to using Bolt's Ruby interpreter and "\
|
21
|
-
"setting the 'puppet-agent' feature in Bolt 3.0. Enable or disable these "\
|
22
|
-
"defaults by setting 'bundled-ruby' in the local transport config."
|
23
|
-
Bolt::Logger.warn_once('local default config', msg)
|
24
|
-
end
|
25
|
-
|
26
18
|
yield Connection.new(target)
|
27
19
|
end
|
28
20
|
end
|
@@ -21,7 +21,7 @@ module Bolt
|
|
21
21
|
|
22
22
|
@logger = logger
|
23
23
|
@key = self.class.get_key(opts)
|
24
|
-
client_opts = opts.slice('token-file', 'cacert', 'job-poll-interval', 'job-poll-timeout')
|
24
|
+
client_opts = opts.slice('token-file', 'cacert', 'job-poll-interval', 'job-poll-timeout', 'read-timeout')
|
25
25
|
|
26
26
|
if opts['service-url']
|
27
27
|
uri = Addressable::URI.parse(opts['service-url'])
|
data/lib/bolt/transport/ssh.rb
CHANGED
@@ -23,8 +23,7 @@ module Bolt
|
|
23
23
|
|
24
24
|
def with_connection(target)
|
25
25
|
if target.transport_config['ssh-command'] && !target.transport_config['native-ssh']
|
26
|
-
Bolt::Logger.warn_once("
|
27
|
-
"native-ssh must be true to use ssh-command")
|
26
|
+
Bolt::Logger.warn_once("native_ssh_disabled", "native-ssh must be true to use ssh-command")
|
28
27
|
end
|
29
28
|
|
30
29
|
conn = if target.transport_config['native-ssh']
|
data/lib/bolt/validator.rb
CHANGED
@@ -147,7 +147,7 @@ module Bolt
|
|
147
147
|
message += " at '#{path}'" if @path.any?
|
148
148
|
message += " at #{@location}" if @location
|
149
149
|
message += "."
|
150
|
-
@warnings << message
|
150
|
+
@warnings << { id: 'unknown_option', msg: message }
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
@@ -160,7 +160,7 @@ module Bolt
|
|
160
160
|
message = "Option '#{path}' "
|
161
161
|
message += "at #{@location} " if @location
|
162
162
|
message += "is deprecated. #{definition[:_deprecation]}"
|
163
|
-
@deprecations << {
|
163
|
+
@deprecations << { id: "#{key}_option", msg: message }
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
data/lib/bolt/version.rb
CHANGED
data/lib/bolt_server/config.rb
CHANGED
@@ -9,7 +9,7 @@ module BoltServer
|
|
9
9
|
def config_keys
|
10
10
|
super + %w[concurrency cache-dir file-server-conn-timeout
|
11
11
|
file-server-uri projects-dir environments-codedir
|
12
|
-
environmentpath basemodulepath]
|
12
|
+
environmentpath basemodulepath builtin-content-dir]
|
13
13
|
end
|
14
14
|
|
15
15
|
def env_keys
|
@@ -280,7 +280,8 @@ module BoltServer
|
|
280
280
|
bolt_config = config_from_project(versioned_project)
|
281
281
|
modulepath_object = Bolt::Config::Modulepath.new(
|
282
282
|
bolt_config.modulepath,
|
283
|
-
boltlib_path: [PE_BOLTLIB_PATH, Bolt::Config::Modulepath::BOLTLIB_PATH]
|
283
|
+
boltlib_path: [PE_BOLTLIB_PATH, Bolt::Config::Modulepath::BOLTLIB_PATH],
|
284
|
+
builtin_content_path: @config['builtin-content-dir']
|
284
285
|
)
|
285
286
|
pal = Bolt::PAL.new(modulepath_object, nil, nil, nil, nil, nil, bolt_config.project)
|
286
287
|
context = {
|
@@ -351,7 +352,7 @@ module BoltServer
|
|
351
352
|
end
|
352
353
|
|
353
354
|
def allowed_helper(metadata, allowlist)
|
354
|
-
allowed = allowlist.nil? || allowlist.include?(metadata['name'])
|
355
|
+
allowed = allowlist.nil? || allowlist.include?(metadata['name'])
|
355
356
|
metadata.merge({ 'allowed' => allowed })
|
356
357
|
end
|
357
358
|
|
data/libexec/bolt_catalog
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
# @summary
|
2
|
+
# Run a task, command, or script on targets and aggregate the results as
|
3
|
+
# a count of targets for each value of a key.
|
4
|
+
#
|
5
|
+
# This plan accepts an action and a list of targets. The action can be the name
|
6
|
+
# of a task, a script, or a command to run. It will run the action on the
|
7
|
+
# targets and aggregate the key/value pairs in each Result into a hash, mapping
|
8
|
+
# the keys to a hash of each distinct value and how many targets returned that
|
9
|
+
# value for the key.
|
10
|
+
#
|
11
|
+
# @param command
|
12
|
+
# The command to run. Mutually exclusive with script and task.
|
13
|
+
# @param script
|
14
|
+
# The path to the script to run. Mutually exclusive with command and task.
|
15
|
+
# @param task
|
16
|
+
# The name of the task to run. Mutually exclusive with command and script.
|
17
|
+
# @param targets
|
18
|
+
# The list of targets to run the action on.
|
19
|
+
# @param params
|
20
|
+
# A hash of parameters and options to pass to the `run_*` function
|
21
|
+
# associated with the action (e.g. run_task).
|
1
22
|
plan aggregate::count(
|
2
23
|
Optional[String[0]] $task = undef,
|
3
24
|
Optional[String[0]] $command = undef,
|
@@ -1,3 +1,24 @@
|
|
1
|
+
# @summary
|
2
|
+
# Run a task, command, or script on targets and aggregate the results as
|
3
|
+
# the list of targets for each value of a key in the results.
|
4
|
+
#
|
5
|
+
# This plan accepts an action and a list of targets. The action can be the name
|
6
|
+
# of a task, a script, or a command to run. It will run the action on the
|
7
|
+
# targets and aggregate the key/value pairs in each Result into a hash, mapping
|
8
|
+
# the keys to a hash of each distinct value and a list of targets returning that
|
9
|
+
# value.
|
10
|
+
#
|
11
|
+
# @param command
|
12
|
+
# The command to run. Mutually exclusive with script and task.
|
13
|
+
# @param script
|
14
|
+
# The path to the script to run. Mutually exclusive with command and task.
|
15
|
+
# @param task
|
16
|
+
# The name of the task to run. Mutually exclusive with command and script.
|
17
|
+
# @param targets
|
18
|
+
# The list of targets to run the action on.
|
19
|
+
# @param params
|
20
|
+
# A hash of parameters and options to pass to the `run_*` function
|
21
|
+
# associated with the action (e.g. run_task).
|
1
22
|
plan aggregate::targets(
|
2
23
|
Optional[String[0]] $task = undef,
|
3
24
|
Optional[String[0]] $command = undef,
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# @summary
|
2
|
+
# Tests that the provided Puppet Connect input data is complete, meaning that all consuming inventory targets are connectable.
|
3
|
+
#
|
4
|
+
# This plan should only be used as part of the copy-pastable "test input data"
|
5
|
+
# workflow specified in the Puppet Connect docs.
|
6
|
+
#
|
7
|
+
# @param targets
|
8
|
+
# The set of targets to test. Usually this should be 'all', the default.
|
9
|
+
#
|
10
|
+
# @return ResultSet the result of invoking the 'is connectable?' query on all
|
11
|
+
# the targets. Note that this query currently consists of running the 'echo'
|
12
|
+
# command.
|
13
|
+
#
|
14
|
+
plan puppet_connect::test_input_data(TargetSpec $targets = 'all') {
|
15
|
+
$targs = get_targets($targets)
|
16
|
+
$targs.each |$target| {
|
17
|
+
if $target.transport != 'ssh' and $target.transport != 'winrm' {
|
18
|
+
fail_plan("Inventory contains target ${target} with unsupported transport, must be ssh or winrm")
|
19
|
+
}
|
20
|
+
if $target.transport == 'ssh' {
|
21
|
+
# Disable SSH autoloading to prevent false positive results
|
22
|
+
# (input data is wrong but target is still connectable due
|
23
|
+
# to autoloaded config)
|
24
|
+
set_config($target, ['ssh', 'load-config'], false)
|
25
|
+
}
|
26
|
+
}
|
27
|
+
# The SSH/WinRM transports will report an 'unknown host' error for targets where
|
28
|
+
# 'host' is unknown so run_command's implementation will take care of raising that
|
29
|
+
# error for us.
|
30
|
+
return run_command('echo Connected', $targs)
|
31
|
+
}
|
@@ -1,3 +1,13 @@
|
|
1
|
+
# @summary
|
2
|
+
# Collect facts for the specified targets from PuppetDB and store them
|
3
|
+
# on the Targets.
|
4
|
+
#
|
5
|
+
# This plan accepts a list of targets to collect facts for from the configured
|
6
|
+
# PuppetDB connection. After collecting facts, they are stored on each target's
|
7
|
+
# Target object. The updated facts can then be accessed using `$target.facts`.
|
8
|
+
#
|
9
|
+
# @param targets
|
10
|
+
# The targets to collect facts for.
|
1
11
|
plan puppetdb_fact(TargetSpec $targets) {
|
2
12
|
$targs = get_targets($targets)
|
3
13
|
$certnames = $targs.map |$target| { $target.host }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: ffi
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "<"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.14.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "<"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.14.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: hiera-eyaml
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +184,14 @@ dependencies:
|
|
170
184
|
requirements:
|
171
185
|
- - "~>"
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version: '0.
|
187
|
+
version: '0.5'
|
174
188
|
type: :runtime
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
192
|
- - "~>"
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version: '0.
|
194
|
+
version: '0.5'
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
196
|
name: puppet
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,14 +212,14 @@ dependencies:
|
|
198
212
|
requirements:
|
199
213
|
- - "~>"
|
200
214
|
- !ruby/object:Gem::Version
|
201
|
-
version: '0.
|
215
|
+
version: '0.5'
|
202
216
|
type: :runtime
|
203
217
|
prerelease: false
|
204
218
|
version_requirements: !ruby/object:Gem::Requirement
|
205
219
|
requirements:
|
206
220
|
- - "~>"
|
207
221
|
- !ruby/object:Gem::Version
|
208
|
-
version: '0.
|
222
|
+
version: '0.5'
|
209
223
|
- !ruby/object:Gem::Dependency
|
210
224
|
name: puppet-resource_api
|
211
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -311,9 +325,6 @@ dependencies:
|
|
311
325
|
- - ">="
|
312
326
|
- !ruby/object:Gem::Version
|
313
327
|
version: '1.14'
|
314
|
-
- - "<"
|
315
|
-
- !ruby/object:Gem::Version
|
316
|
-
version: 2.2.0
|
317
328
|
type: :development
|
318
329
|
prerelease: false
|
319
330
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -321,9 +332,6 @@ dependencies:
|
|
321
332
|
- - ">="
|
322
333
|
- !ruby/object:Gem::Version
|
323
334
|
version: '1.14'
|
324
|
-
- - "<"
|
325
|
-
- !ruby/object:Gem::Version
|
326
|
-
version: 2.2.0
|
327
335
|
- !ruby/object:Gem::Dependency
|
328
336
|
name: octokit
|
329
337
|
requirement: !ruby/object:Gem::Requirement
|
@@ -342,16 +350,16 @@ dependencies:
|
|
342
350
|
name: puppetlabs_spec_helper
|
343
351
|
requirement: !ruby/object:Gem::Requirement
|
344
352
|
requirements:
|
345
|
-
- - "
|
353
|
+
- - "<="
|
346
354
|
- !ruby/object:Gem::Version
|
347
|
-
version:
|
355
|
+
version: 2.15.0
|
348
356
|
type: :development
|
349
357
|
prerelease: false
|
350
358
|
version_requirements: !ruby/object:Gem::Requirement
|
351
359
|
requirements:
|
352
|
-
- - "
|
360
|
+
- - "<="
|
353
361
|
- !ruby/object:Gem::Version
|
354
|
-
version:
|
362
|
+
version: 2.15.0
|
355
363
|
- !ruby/object:Gem::Dependency
|
356
364
|
name: rake
|
357
365
|
requirement: !ruby/object:Gem::Requirement
|
@@ -515,6 +523,7 @@ files:
|
|
515
523
|
- lib/bolt/plugin/env_var.rb
|
516
524
|
- lib/bolt/plugin/module.rb
|
517
525
|
- lib/bolt/plugin/prompt.rb
|
526
|
+
- lib/bolt/plugin/puppet_connect_data.rb
|
518
527
|
- lib/bolt/plugin/puppetdb.rb
|
519
528
|
- lib/bolt/plugin/task.rb
|
520
529
|
- lib/bolt/project.rb
|
@@ -600,12 +609,12 @@ files:
|
|
600
609
|
- modules/aggregate/lib/puppet/functions/aggregate/nodes.rb
|
601
610
|
- modules/aggregate/lib/puppet/functions/aggregate/targets.rb
|
602
611
|
- modules/aggregate/plans/count.pp
|
603
|
-
- modules/aggregate/plans/nodes.pp
|
604
612
|
- modules/aggregate/plans/targets.pp
|
605
613
|
- modules/canary/lib/puppet/functions/canary/merge.rb
|
606
614
|
- modules/canary/lib/puppet/functions/canary/random_split.rb
|
607
615
|
- modules/canary/lib/puppet/functions/canary/skip.rb
|
608
616
|
- modules/canary/plans/init.pp
|
617
|
+
- modules/puppet_connect/plans/test_input_data.pp
|
609
618
|
- modules/puppetdb_fact/plans/init.pp
|
610
619
|
homepage: https://github.com/puppetlabs/bolt
|
611
620
|
licenses:
|
@@ -626,7 +635,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
626
635
|
- !ruby/object:Gem::Version
|
627
636
|
version: '0'
|
628
637
|
requirements: []
|
629
|
-
rubygems_version: 3.0.
|
638
|
+
rubygems_version: 3.0.8
|
630
639
|
signing_key:
|
631
640
|
specification_version: 4
|
632
641
|
summary: Execute commands remotely over SSH and WinRM
|