beaker-task_helper 1.7.4 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/beaker-task_helper.rb +11 -3
- data/lib/beaker-task_helper/inventory.rb +11 -3
- data/lib/beaker-task_helper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bde2b067d8b91239fecd8d0575bb0f1aead07bbecab43e0e94fe9a810540bb3
|
4
|
+
data.tar.gz: d726f66dfaa8ba05c27f2984f0816ee9f4615b04ae043e006bc47b2963bdc293
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 069c72b69f6d2aacdeaeb889b3582e2e1828498b76b5401fbb6622b95ed9cab4ae15ce07381c13c0613b242f880e593e7d98776e9c305b014df901e4a0e8accf
|
7
|
+
data.tar.gz: 734f52539d22377301826cb19215ff0e5e1f1d816e4a9ea08d62ba9afe7f5c318657c6caa150eba1da467be9808f950c2483cf85ec5883d50a0514d8974f33dd
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,15 @@
|
|
1
1
|
# Change Log
|
2
|
+
### 1.8.0
|
3
|
+
### Changed
|
4
|
+
- Updated the helper to be compatible with [Bolt 2.0 changes](https://github.com/puppetlabs/bolt/blob/master/CHANGELOG.md). *Bolt 2.0 introduced some [backwards-incompatible changes](https://github.com/puppetlabs/bolt/blob/master/CHANGELOG.md#bolt-200-2020-02-19) that you should be aware of before upgrading to this version.*
|
5
|
+
|
6
|
+
### 1.7.1-4
|
7
|
+
### Fixed
|
8
|
+
- `.ssh` directory path on OSX 10.12/10.13/10.14 and Solaris 10
|
9
|
+
- Puppet 6 collection handling fix
|
10
|
+
- PE `puppet access login` fixes
|
11
|
+
|
12
|
+
|
2
13
|
## 1.7.0
|
3
14
|
### Added
|
4
15
|
- (maint) - Work around for [BOLT-845](https://tickets.puppetlabs.com/browse/BOLT-845), installing ffi on el5 machines).
|
data/lib/beaker-task_helper.rb
CHANGED
@@ -64,6 +64,14 @@ INSTALL_BOLT_PP
|
|
64
64
|
ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
|
65
65
|
end
|
66
66
|
|
67
|
+
def target_flag
|
68
|
+
if version_is_less('1.18.0', BOLT_VERSION)
|
69
|
+
'--targets'
|
70
|
+
else
|
71
|
+
'--nodes'
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
67
75
|
def run_puppet_access_login(user:, password: '~!@#$%^*-/ aZ', lifetime: '5y')
|
68
76
|
peconf_password = get_unwrapped_pe_conf_value("console_admin_password")
|
69
77
|
password = peconf_password if peconf_password != nil && peconf_password != ""
|
@@ -141,7 +149,7 @@ INSTALL_BOLT_PP
|
|
141
149
|
end
|
142
150
|
|
143
151
|
bolt_full_cli = "#{bolt_path} task run #{task_name} #{check} -m #{module_path} " \
|
144
|
-
"
|
152
|
+
"#{target_flag} #{host} --password #{password}"
|
145
153
|
bolt_full_cli << " --format #{format}" if format != 'human'
|
146
154
|
bolt_full_cli << if params.class == Hash
|
147
155
|
" --params '#{params.to_json}'"
|
@@ -157,7 +165,7 @@ INSTALL_BOLT_PP
|
|
157
165
|
end
|
158
166
|
|
159
167
|
def run_puppet_task(task_name:, params: nil, host: '127.0.0.1', format: 'human')
|
160
|
-
args = ['task', 'run', task_name,
|
168
|
+
args = ['task', 'run', task_name, target_flag, host]
|
161
169
|
if params.class == Hash
|
162
170
|
args << '--params'
|
163
171
|
args << params.to_json
|
@@ -178,7 +186,7 @@ INSTALL_BOLT_PP
|
|
178
186
|
end
|
179
187
|
|
180
188
|
def task_summary_line(total_hosts: 1, success_hosts: 1)
|
181
|
-
"Job completed. #{success_hosts}/#{total_hosts}
|
189
|
+
"Job completed. #{success_hosts}/#{total_hosts} targets succeeded|Ran on #{total_hosts} target"
|
182
190
|
end
|
183
191
|
end
|
184
192
|
|
@@ -3,6 +3,14 @@ require 'beaker'
|
|
3
3
|
module Beaker
|
4
4
|
module TaskHelper
|
5
5
|
module Inventory
|
6
|
+
def target_key
|
7
|
+
if version_is_less('1.18.0', BOLT_VERSION)
|
8
|
+
'targets'
|
9
|
+
else
|
10
|
+
'nodes'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
6
14
|
# This attempts to make a bolt inventory hash from beakers hosts
|
7
15
|
# roles should be targetable by bolt as groups
|
8
16
|
def hosts_to_inventory
|
@@ -12,10 +20,10 @@ module Beaker
|
|
12
20
|
if group_name =~ %r{\A[a-z0-9_]+\Z}
|
13
21
|
group = groups.find { |g| g['name'] == group_name }
|
14
22
|
unless group
|
15
|
-
group = { 'name' => group_name,
|
23
|
+
group = { 'name' => group_name, target_key => [] }
|
16
24
|
groups << group
|
17
25
|
end
|
18
|
-
group[
|
26
|
+
group[target_key] << node
|
19
27
|
else
|
20
28
|
puts "invalid group name #{group_name} skipping"
|
21
29
|
end
|
@@ -66,7 +74,7 @@ module Beaker
|
|
66
74
|
}
|
67
75
|
end
|
68
76
|
|
69
|
-
{
|
77
|
+
{ target_key => nodes,
|
70
78
|
'groups' => groups,
|
71
79
|
'config' => {
|
72
80
|
'ssh' => {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-task_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|