beaker 7.8.1 → 7.8.2
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/CHANGELOG.md +13 -2
- data/lib/beaker/host_prebuilt_steps.rb +37 -0
- data/lib/beaker/platform.rb +7 -2
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/host_prebuilt_steps_spec.rb +25 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 81a5056bbf75fb1a2d0203ea5885a278d12300fc339415e5afeeb46ebef8d785
|
|
4
|
+
data.tar.gz: e5a03effce21a9d74058016da1dcdf3421c9f9ccb2ea9717b295c8b5f99a16b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c7ce30592e319300a0dfe9d864c4194ba1ea6eaf86febb0b0c1b8122ae9f6ec7ab4a7e718a7b0e43a48c64746f9226d4cad83688d6f71871ab9e57282e25d7e
|
|
7
|
+
data.tar.gz: 0cb47533c54b7ef3497652a1b4396ea90c53f5cf2ef7e6c9a3a964826b1cf782e75f46cd371ce38de33ae7a7249f9f6f3631d2818014c9acec11aae40dd7d7da
|
data/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [7.8.
|
|
5
|
+
## [7.8.2](https://github.com/voxpupuli/beaker/tree/7.8.2) (2026-09-09)
|
|
6
6
|
|
|
7
|
-
[Full Changelog](https://github.com/voxpupuli/beaker/compare/v7.8.
|
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/beaker/compare/v7.8.1...7.8.2)
|
|
8
|
+
|
|
9
|
+
**Fixed bugs:**
|
|
10
|
+
|
|
11
|
+
- Create root's dotfiles on EL 8+ hosts \(the other half of \#2033\) [\#2037](https://github.com/voxpupuli/beaker/pull/2037) ([silug](https://github.com/silug))
|
|
12
|
+
- Fix NTP on Ubuntu 26.04 by using chrony [\#2036](https://github.com/voxpupuli/beaker/pull/2036) ([bwitt](https://github.com/bwitt))
|
|
13
|
+
- Install iproute on EL 8+ hosts [\#2035](https://github.com/voxpupuli/beaker/pull/2035) ([silug](https://github.com/silug))
|
|
14
|
+
- Fix Debian 13 NTP setup by using chrony [\#1996](https://github.com/voxpupuli/beaker/pull/1996) ([treydock](https://github.com/treydock))
|
|
15
|
+
|
|
16
|
+
## [v7.8.1](https://github.com/voxpupuli/beaker/tree/v7.8.1) (2026-09-04)
|
|
17
|
+
|
|
18
|
+
[Full Changelog](https://github.com/voxpupuli/beaker/compare/v7.8.0...v7.8.1)
|
|
8
19
|
|
|
9
20
|
**Fixed bugs:**
|
|
10
21
|
|
|
@@ -13,6 +13,13 @@ module Beaker
|
|
|
13
13
|
ETC_HOSTS_PATH = "/etc/hosts"
|
|
14
14
|
ETC_HOSTS_PATH_SOLARIS = "/etc/inet/hosts"
|
|
15
15
|
ROOT_KEYS_SCRIPT = "https://raw.githubusercontent.com/puppetlabs/puppetlabs-sshkeys/master/templates/scripts/manage_root_authorized_keys"
|
|
16
|
+
# Prefer the mechanism a booted host uses (the tmpfiles rule); fall back
|
|
17
|
+
# to copying the templates where systemd-tmpfiles is not available.
|
|
18
|
+
ROOT_DOTFILES_SYNC_CMD = 'if [ -f /usr/lib/tmpfiles.d/rootfiles.conf ] && command -v systemd-tmpfiles >/dev/null 2>&1; then ' \
|
|
19
|
+
'systemd-tmpfiles --create rootfiles.conf; ' \
|
|
20
|
+
'elif [ -d /usr/share/rootfiles ]; then ' \
|
|
21
|
+
'for f in /usr/share/rootfiles/.[!.]*; do [ -e "/root/${f##*/}" ] || cp -p "$f" /root/; done; ' \
|
|
22
|
+
'fi'
|
|
16
23
|
ROOT_KEYS_SYNC_CMD = "curl -k -o - -L #{ROOT_KEYS_SCRIPT} | %s"
|
|
17
24
|
ROOT_KEYS_SYNC_CMD_AIX = "curl --tlsv1 -o - -L #{ROOT_KEYS_SCRIPT} | %s"
|
|
18
25
|
|
|
@@ -72,11 +79,41 @@ module Beaker
|
|
|
72
79
|
logger = opts[:logger]
|
|
73
80
|
block_on host do |host|
|
|
74
81
|
check_and_install_packages_if_needed(host, host_packages(host))
|
|
82
|
+
ensure_root_dotfiles(host)
|
|
75
83
|
end
|
|
76
84
|
rescue => e
|
|
77
85
|
report_and_raise(logger, e, "validate")
|
|
78
86
|
end
|
|
79
87
|
|
|
88
|
+
# Make sure root's shell dotfiles exist on EL 8+ and Fedora hosts.
|
|
89
|
+
#
|
|
90
|
+
# Since rootfiles 8.1-32 (EL 9+) and 9.0 (Fedora 43+), `/root/.bashrc`
|
|
91
|
+
# and friends are no longer shipped as regular files: they are %ghost
|
|
92
|
+
# entries that systemd-tmpfiles copies out of `/usr/share/rootfiles` at
|
|
93
|
+
# boot, per `/usr/lib/tmpfiles.d/rootfiles.conf`. Nothing else runs that
|
|
94
|
+
# rule -- the systemd package carries no tmpfiles file trigger -- so in a
|
|
95
|
+
# container, which is never booted, installing the package leaves /root
|
|
96
|
+
# without the dotfiles.
|
|
97
|
+
#
|
|
98
|
+
# That matters because a non-interactive bash started by sshd only
|
|
99
|
+
# sources `/etc/bashrc` (and from there `/etc/profile.d/*.sh`) through
|
|
100
|
+
# `~/.bashrc`. Without it, PATH additions made in profile.d, such as
|
|
101
|
+
# `/etc/profile.d/puppet-agent.sh`, never reach commands run over ssh.
|
|
102
|
+
#
|
|
103
|
+
# Apply the tmpfiles rule the way boot would, and fall back to copying
|
|
104
|
+
# the templates when systemd-tmpfiles is not installed. Either path only
|
|
105
|
+
# creates files that are missing, so this is a no-op on a booted host,
|
|
106
|
+
# on hosts whose rootfiles still ships the files directly (no rule and no
|
|
107
|
+
# `/usr/share/rootfiles`), and for any customised file already in /root.
|
|
108
|
+
#
|
|
109
|
+
# @param [Host] host Host to act on
|
|
110
|
+
def ensure_root_dotfiles(host)
|
|
111
|
+
platform = host['platform']
|
|
112
|
+
return unless (platform.variant == 'el' && platform.version.to_i >= 8) || platform.variant == 'fedora'
|
|
113
|
+
|
|
114
|
+
host.exec(Command.new(ROOT_DOTFILES_SYNC_CMD), :accept_all_exit_codes => true)
|
|
115
|
+
end
|
|
116
|
+
|
|
80
117
|
# Return a list of packages that should be present.
|
|
81
118
|
#
|
|
82
119
|
# @param [Host] host A host return the packages for
|
data/lib/beaker/platform.rb
CHANGED
|
@@ -109,6 +109,11 @@ module Beaker
|
|
|
109
109
|
true
|
|
110
110
|
when 'el'
|
|
111
111
|
@version.to_i >= 8
|
|
112
|
+
when 'debian'
|
|
113
|
+
@version.to_i >= 13
|
|
114
|
+
when 'ubuntu'
|
|
115
|
+
# version may be '2604' or '26.04'
|
|
116
|
+
@version.delete('.').to_i >= 2604
|
|
112
117
|
else
|
|
113
118
|
false
|
|
114
119
|
end
|
|
@@ -120,7 +125,7 @@ module Beaker
|
|
|
120
125
|
def base_packages
|
|
121
126
|
case @variant
|
|
122
127
|
when 'el'
|
|
123
|
-
@version.to_i >= 8 ? %w[iputils rootfiles] : %w[curl]
|
|
128
|
+
@version.to_i >= 8 ? %w[iputils iproute rootfiles] : %w[curl]
|
|
124
129
|
when 'debian'
|
|
125
130
|
%w[curl lsb-release]
|
|
126
131
|
when 'freebsd'
|
|
@@ -132,7 +137,7 @@ module Beaker
|
|
|
132
137
|
when 'amazon', 'amazonfips'
|
|
133
138
|
['iputils']
|
|
134
139
|
when 'fedora'
|
|
135
|
-
%w[iputils iproute]
|
|
140
|
+
%w[iputils iproute rootfiles]
|
|
136
141
|
when 'aix', 'osx', 'windows'
|
|
137
142
|
[]
|
|
138
143
|
else
|
data/lib/beaker/version.rb
CHANGED
|
@@ -276,10 +276,27 @@ describe Beaker do
|
|
|
276
276
|
it "can validate el-9 hosts" do
|
|
277
277
|
host = make_host('host', { :platform => 'el-9-64' })
|
|
278
278
|
|
|
279
|
-
%w[iputils rootfiles].each do |pkg|
|
|
279
|
+
%w[iputils iproute rootfiles].each do |pkg|
|
|
280
280
|
expect(host).to receive(:check_for_package).with(pkg).once.and_return(false)
|
|
281
281
|
expect(host).to receive(:install_package).with(pkg).once
|
|
282
282
|
end
|
|
283
|
+
# rootfiles alone is not enough in a container: its dotfiles are
|
|
284
|
+
# tmpfiles-created %ghost files, so the tmpfiles rule is applied too
|
|
285
|
+
expect(host).to receive(:exec).with(
|
|
286
|
+
satisfy { |cmd| cmd.command.include?('systemd-tmpfiles --create rootfiles.conf') && cmd.command.include?('/usr/share/rootfiles') },
|
|
287
|
+
{ :accept_all_exit_codes => true },
|
|
288
|
+
).once
|
|
289
|
+
|
|
290
|
+
subject.validate_host(host, options)
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
it "does not touch root's dotfiles on non-EL hosts" do
|
|
294
|
+
host = make_host('host', { :platform => 'debian-12-64' })
|
|
295
|
+
allow(host).to receive(:check_for_package).and_return(true)
|
|
296
|
+
|
|
297
|
+
expect(host).not_to receive(:exec).with(
|
|
298
|
+
satisfy { |cmd| cmd.command.include?('/usr/share/rootfiles') }, anything
|
|
299
|
+
)
|
|
283
300
|
|
|
284
301
|
subject.validate_host(host, options)
|
|
285
302
|
end
|
|
@@ -321,7 +338,7 @@ describe Beaker do
|
|
|
321
338
|
it "can validate RHEL8 hosts" do
|
|
322
339
|
host = make_host('host', { :platform => 'el-8-64' })
|
|
323
340
|
|
|
324
|
-
%w[iputils rootfiles].each do |pkg|
|
|
341
|
+
%w[iputils iproute rootfiles].each do |pkg|
|
|
325
342
|
expect(host).to receive(:check_for_package).with(pkg).once.and_return(false)
|
|
326
343
|
expect(host).to receive(:install_package).with(pkg).once
|
|
327
344
|
end
|
|
@@ -332,10 +349,15 @@ describe Beaker do
|
|
|
332
349
|
it "can validate Fedora hosts" do
|
|
333
350
|
host = make_host('host', { :platform => 'fedora-32-x86_64' })
|
|
334
351
|
|
|
335
|
-
[
|
|
352
|
+
%w[iputils iproute rootfiles].each do |pkg|
|
|
336
353
|
expect(host).to receive(:check_for_package).with(pkg).once.and_return(false)
|
|
337
354
|
expect(host).to receive(:install_package).with(pkg).once
|
|
338
355
|
end
|
|
356
|
+
# Fedora 43+ rootfiles is tmpfiles-based like EL 9+, so the rule is applied too
|
|
357
|
+
expect(host).to receive(:exec).with(
|
|
358
|
+
satisfy { |cmd| cmd.command.include?('systemd-tmpfiles --create rootfiles.conf') },
|
|
359
|
+
{ :accept_all_exit_codes => true },
|
|
360
|
+
).once
|
|
339
361
|
|
|
340
362
|
subject.validate_host(host, options)
|
|
341
363
|
end
|