Skip to content

Commit

Permalink
Update /etc/hosts when hostname changes
Browse files Browse the repository at this point in the history
Fixes #224
  • Loading branch information
silug committed Dec 19, 2024
1 parent 1434ced commit b35795b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.34.2 / 2024-12-19
* Fixed:
* Update /etc/hosts when hostname changes (#224)

### 1.34.1 / 2024-12-17
* Fixed:
* Error when no domain is set (#222)
Expand Down
2 changes: 1 addition & 1 deletion lib/simp/beaker_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ def linux_errata( suts )
if current_domain.nil? || current_domain.empty?
new_fqdn = hostname + '.beaker.test'

safe_sed(sut, 's/#{hostname}.*/#{new_fqdn} #{hostname}/', '/etc/hosts')
safe_sed(sut, "s/#{hostname}.*/#{new_fqdn} #{hostname}/", '/etc/hosts')

if !sut.which('hostnamectl').empty?
on(sut, "hostnamectl set-hostname #{new_fqdn}")
Expand Down
2 changes: 1 addition & 1 deletion lib/simp/beaker_helpers/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
module Simp; end

module Simp::BeakerHelpers
VERSION = '1.34.1'
VERSION = '1.34.2'
end

0 comments on commit b35795b

Please sign in to comment.