Skip to content

Commit 0c3db6d

Browse files
authored
Update /etc/hosts on all nodes when hostname changes (#228)
Fixes #227
1 parent b35795b commit 0c3db6d

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 1.34.3 / 2024-12-20
2+
* Fixed:
3+
* Update /etc/hosts on all nodes when hostname changes (#227)
4+
15
### 1.34.2 / 2024-12-19
26
* Fixed:
37
* Update /etc/hosts when hostname changes (#224)

Diff for: lib/simp/beaker_helpers.rb

+8-5
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def linux_errata( suts )
729729
if current_domain.nil? || current_domain.empty?
730730
new_fqdn = hostname + '.beaker.test'
731731

732-
safe_sed(sut, "s/#{hostname}.*/#{new_fqdn} #{hostname}/", '/etc/hosts')
732+
safe_sed(suts, "s/#{hostname}.*/#{new_fqdn} #{hostname}/", '/etc/hosts')
733733

734734
if !sut.which('hostnamectl').empty?
735735
on(sut, "hostnamectl set-hostname #{new_fqdn}")
@@ -939,8 +939,13 @@ def rhel_rhsm_unsubscribe(suts)
939939

940940
# Apply known OS fixes we need to run Beaker on each SUT
941941
def fix_errata_on( suts = hosts )
942-
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
943-
if is_windows?(sut)
942+
windows_suts = suts.select { |sut| is_windows?(sut) }
943+
linux_suts = suts - windows_suts
944+
945+
linux_errata(linux_suts) unless linux_suts.empty?
946+
947+
unless windows_suts.empty?
948+
block_on(windows_suts, :run_in_parallel => @run_in_parallel) do |sut|
944949
# Load the Windows requirements
945950
require 'simp/beaker_helpers/windows'
946951

@@ -971,8 +976,6 @@ def fix_errata_on( suts = hosts )
971976
EOM
972977

973978
install_cert_on_windows(sut, 'geotrustglobal', geotrust_global_ca)
974-
else
975-
linux_errata(sut)
976979
end
977980
end
978981

Diff for: lib/simp/beaker_helpers/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
module Simp; end
44

55
module Simp::BeakerHelpers
6-
VERSION = '1.34.2'
6+
VERSION = '1.34.3'
77
end

0 commit comments

Comments
 (0)