Skip to content

Commit

Permalink
(#168) Handling a missing /etc/localtime file instead of breaking
Browse files Browse the repository at this point in the history
Fixes #168
  • Loading branch information
michael-riddle committed Dec 6, 2023
1 parent 9c5b4d0 commit 2c68450
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Wed Dec 06 2023 Mike Riddle <[email protected]> - 6.17.1
- The module will now correctly handle a situation where /etc/localhost doesn't exist

* Mon Oct 23 2023 Steven Pritchard <[email protected]> - 6.17.0
- [puppetsync] Add EL9 support

Expand Down
10 changes: 9 additions & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@
require => Package['openssh-server']
}

# It is possible that /etc/localtime won't exist on the system.
# In the case where it doesn't simply pull the timezone file from
# /usr/share/zoneinfo
$_timezone_file = find_file('/etc/localtime') ? {
undef => "/usr/share/zoneinfo/${facts['timezone']}",
default => '/etc/localtime'
}

file { '/var/empty/sshd/etc/localtime':
source => 'file:///etc/localtime',
source => "file://${_timezone_file}",
owner => 'root',
group => 'root',
mode => '0644',
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simp-ssh",
"version": "6.17.0",
"version": "6.17.1",
"author": "SIMP Team",
"summary": "Manage ssh",
"license": "Apache-2.0",
Expand Down

0 comments on commit 2c68450

Please sign in to comment.