Skip to content

Commit

Permalink
manage legacy symlink on Debian >12
Browse files Browse the repository at this point in the history
  • Loading branch information
saz committed May 18, 2024
1 parent c2feca1 commit 797c062
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@

$update_locale_require = Package[$update_locale_pkg]
} else {
$update_locale_require = Package[$package]
if $manage_package {
$update_locale_require = Package[$package]
} else {
$update_locale_require = undef
}
}

if $locale_gen_cmd {
Expand Down Expand Up @@ -237,6 +241,14 @@
require => $update_locale_require,
}

$debian_legacy_location = '/etc/default/locale'
if $facts['os']['name'] == 'Debian' and $default_file != $debian_legacy_location {
file { $debian_legacy_location:
ensure => $ensure,
target => $default_file,
}
}

if $update_locale_cmd {
exec { 'update-locale':
command => $update_locale_cmd,
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/(Ubuntu|Debian|LinuxMint|Linuxmint|Raspbian|Kali|Pop!_OS)/: {
case $facts['os']['name'] {
'Debian': {
if versioncmp($facts['os']['release']['full'], '12') >= 0 {
if versioncmp($facts['os']['release']['full'], '12') > 0 {
$default_file = '/etc/locale.conf'
}
}
Expand Down

0 comments on commit 797c062

Please sign in to comment.