bolt 3.28.0 → 3.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Puppetfile +16 -16
- data/bolt-modules/file/lib/puppet/functions/file/delete.rb +21 -0
- data/lib/bolt/config.rb +1 -1
- data/lib/bolt/inventory/target.rb +1 -1
- data/lib/bolt/puppetdb/config.rb +7 -1
- data/lib/bolt/shell/powershell/snippets.rb +13 -9
- data/lib/bolt/util.rb +11 -0
- data/lib/bolt/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b5a8936e9789e8d1a722b5cc76cedf594a8f09709352b95ed6e423f0d7ddc6e
|
4
|
+
data.tar.gz: ef052d1f831ba328d6949a1f33ec617f933f2f28e862d23264ed1dfd9b43b0a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1eeec5f42a0f82a751d5eaa834a42e66d26080a0250e680d4c6328e7fb3a2048f13093d65dc6a7d55220963d8178cbaee7744643f17dd82af44d92b3187c3a6
|
7
|
+
data.tar.gz: 6cd501114d6efc60a26df945e528b03a610018c287a9e03b722f15da5a37680655df1dc953702922e0c306376adcb9e536b30f6aedb1b24a4efe9e97fc3da504
|
data/Puppetfile
CHANGED
@@ -5,27 +5,27 @@ forge 'https://forge.puppetlabs.com'
|
|
5
5
|
moduledir File.join(File.dirname(__FILE__), 'modules')
|
6
6
|
|
7
7
|
# Core modules used by 'apply'
|
8
|
-
mod 'puppetlabs-service', '
|
9
|
-
mod 'puppetlabs-puppet_agent', '4.
|
8
|
+
mod 'puppetlabs-service', '3.0.0'
|
9
|
+
mod 'puppetlabs-puppet_agent', '4.19.0'
|
10
10
|
mod 'puppetlabs-facts', '1.4.0'
|
11
11
|
|
12
12
|
# Core types and providers for Puppet 6
|
13
|
-
mod 'puppetlabs-augeas_core', '1.
|
14
|
-
mod 'puppetlabs-host_core', '1.
|
15
|
-
mod 'puppetlabs-scheduled_task', '
|
16
|
-
mod 'puppetlabs-sshkeys_core', '2.
|
17
|
-
mod 'puppetlabs-zfs_core', '1.
|
18
|
-
mod 'puppetlabs-cron_core', '1.
|
19
|
-
mod 'puppetlabs-mount_core', '1.
|
20
|
-
mod 'puppetlabs-selinux_core', '1.
|
21
|
-
mod 'puppetlabs-yumrepo_core', '
|
22
|
-
mod 'puppetlabs-zone_core', '1.0
|
13
|
+
mod 'puppetlabs-augeas_core', '1.5.0'
|
14
|
+
mod 'puppetlabs-host_core', '1.3.0'
|
15
|
+
mod 'puppetlabs-scheduled_task', '4.0.0'
|
16
|
+
mod 'puppetlabs-sshkeys_core', '2.5.0'
|
17
|
+
mod 'puppetlabs-zfs_core', '1.5.0'
|
18
|
+
mod 'puppetlabs-cron_core', '1.3.0'
|
19
|
+
mod 'puppetlabs-mount_core', '1.3.0'
|
20
|
+
mod 'puppetlabs-selinux_core', '1.4.0'
|
21
|
+
mod 'puppetlabs-yumrepo_core', '2.1.0'
|
22
|
+
mod 'puppetlabs-zone_core', '1.2.0'
|
23
23
|
|
24
24
|
# Useful additional modules
|
25
|
-
mod 'puppetlabs-package', '
|
26
|
-
mod 'puppetlabs-puppet_conf', '
|
27
|
-
mod 'puppetlabs-reboot', '
|
28
|
-
mod 'puppetlabs-stdlib', '
|
25
|
+
mod 'puppetlabs-package', '3.0.1'
|
26
|
+
mod 'puppetlabs-puppet_conf', '2.0.0'
|
27
|
+
mod 'puppetlabs-reboot', '5.0.0'
|
28
|
+
mod 'puppetlabs-stdlib', '9.6.0'
|
29
29
|
|
30
30
|
# Task helpers
|
31
31
|
mod 'puppetlabs-powershell_task_helper', '0.1.0'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Delete a file on localhost using ruby's `File.delete`. This will only delete
|
4
|
+
# files on the machine you run Bolt on.
|
5
|
+
Puppet::Functions.create_function(:'file::delete') do
|
6
|
+
# @param filename Absolute path.
|
7
|
+
# @example Delete a file from disk
|
8
|
+
# file::delete('C:/Users/me/report')
|
9
|
+
dispatch :delete do
|
10
|
+
required_param 'String[1]', :filename
|
11
|
+
return_type 'Undef'
|
12
|
+
end
|
13
|
+
|
14
|
+
def delete(filename)
|
15
|
+
# Send Analytics Report
|
16
|
+
Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
|
17
|
+
|
18
|
+
File.delete(filename)
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
end
|
data/lib/bolt/config.rb
CHANGED
data/lib/bolt/puppetdb/config.rb
CHANGED
@@ -60,7 +60,7 @@ module Bolt
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def token
|
63
|
-
return @token if @
|
63
|
+
return @token if @token_computed
|
64
64
|
# Allow nil in config to skip loading a token
|
65
65
|
if @settings.include?('token')
|
66
66
|
if @settings['token']
|
@@ -69,6 +69,12 @@ module Bolt
|
|
69
69
|
elsif File.exist?(DEFAULT_TOKEN)
|
70
70
|
@token = File.read(DEFAULT_TOKEN)
|
71
71
|
end
|
72
|
+
# Only use cert based auth in the case token and cert are both configured
|
73
|
+
if @token && cert
|
74
|
+
Bolt::Logger.logger(self).debug("Both cert and token based auth configured, using cert only")
|
75
|
+
@token = nil
|
76
|
+
end
|
77
|
+
@token_computed = true
|
72
78
|
@token = @token.strip if @token
|
73
79
|
end
|
74
80
|
|
@@ -55,21 +55,25 @@ module Bolt
|
|
55
55
|
}
|
56
56
|
#{build_arg_list}
|
57
57
|
|
58
|
-
|
58
|
+
try
|
59
59
|
{
|
60
|
-
|
60
|
+
switch -regex ( Get-ExecutionPolicy )
|
61
61
|
{
|
62
|
-
|
63
|
-
|
62
|
+
'^AllSigned'
|
63
|
+
{
|
64
|
+
if ((Get-AuthenticodeSignature -File "#{script_path}").Status -ne 'Valid') {
|
65
|
+
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} and script '#{script_path}' does not contain a valid signature.")
|
66
|
+
exit 1;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
'^Restricted'
|
70
|
+
{
|
71
|
+
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} which denies running any scripts on the target.")
|
64
72
|
exit 1;
|
65
73
|
}
|
66
74
|
}
|
67
|
-
'^Restricted'
|
68
|
-
{
|
69
|
-
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} which denies running any scripts on the target.")
|
70
|
-
exit 1;
|
71
|
-
}
|
72
75
|
}
|
76
|
+
catch {}
|
73
77
|
|
74
78
|
if([string]::IsNullOrEmpty($invokeArgs.ScriptBlock)){
|
75
79
|
$Host.UI.WriteErrorLine("Error: Failed to obtain scriptblock from '#{script_path}'. Running scripts might be disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170");
|
data/lib/bolt/util.rb
CHANGED
@@ -212,6 +212,17 @@ module Bolt
|
|
212
212
|
hash1.merge(hash2, &recursive_merge)
|
213
213
|
end
|
214
214
|
|
215
|
+
def deep_merge!(hash1, hash2)
|
216
|
+
recursive_merge = proc do |_key, h1, h2|
|
217
|
+
if h1.is_a?(Hash) && h2.is_a?(Hash)
|
218
|
+
h1.merge!(h2, &recursive_merge)
|
219
|
+
else
|
220
|
+
h2
|
221
|
+
end
|
222
|
+
end
|
223
|
+
hash1.merge!(hash2, &recursive_merge)
|
224
|
+
end
|
225
|
+
|
215
226
|
# Accepts a Data object and returns a copy with all hash keys
|
216
227
|
# modified by block. use &:to_s to stringify keys or &:to_sym to symbolize them
|
217
228
|
def walk_keys(data, &block)
|
data/lib/bolt/version.rb
CHANGED
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: 3.
|
4
|
+
version: 3.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -473,6 +473,7 @@ files:
|
|
473
473
|
- bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
|
474
474
|
- bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb
|
475
475
|
- bolt-modules/dir/lib/puppet/functions/dir/children.rb
|
476
|
+
- bolt-modules/file/lib/puppet/functions/file/delete.rb
|
476
477
|
- bolt-modules/file/lib/puppet/functions/file/exists.rb
|
477
478
|
- bolt-modules/file/lib/puppet/functions/file/join.rb
|
478
479
|
- bolt-modules/file/lib/puppet/functions/file/read.rb
|