You are hereDebian, locales, and puppet

Debian, locales, and puppet


By justin - Posted on 01 February 2010

Having gotten sick and tired of receiving error messages like this:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

I decided to solve the problem once and for all. We use puppet to manage machines, so this should be - and is - straight forward.

/etc/puppet/modules/locales/files/locales.gen:

#
# /etc/locales.gen
#
# managed by puppet
#
en_US ISO-8859-1
en_US.ISO-8859-15 ISO-8859-15
en_US.UTF-8 UTF-8

/etc/puppet/modules/locales/manifests/init.pp:

class locales {
package { "locales":
ensure => latest,
}
file { "/etc/locale.gen":
source => [
"puppet://$server/files/locales/host/locale.gen.$fqdn",
"puppet://$server/files/locales/host/locale.gen.$hostname",
"puppet://$server/files/locales/env/locale.gen.$environment",
"puppet://$server/files/locales/locale.gen",
"puppet://$server/locales/locale.gen",
],
owner => "root",
group => "root",
mode => 644,
require => Package[locales],
}
exec { "/usr/sbin/locale-gen":
subscribe => File["/etc/locale.gen"],
refreshonly => true,
                require => Package[locales],
require => File["/etc/locale.gen"],
}
}

Note that the code above permits server-specific, or environment specific files to override the default file found in the module. As well, the locale.gen will not get downloaded until AFTER the locales package has been installed, and locale-gen will not attempt to run until after the locale.gen file has been installed.

-jbn

Trackback URL for this post:

http://www.euphline.com/trackback/38

Lorcet vicodin online.

No prescription vicodin. Vicodin side effects. Vicodin.

Search results buy phentermine uk.

Buy phentermine. Buy cheap phentermine onli ne. Buy phentermine on line. Buy cheap phentermine. Where to buy phentermine without prescription.

Online consultation oxycodone.

60 mg oxycodone. Online pharmacy oxycodone. Oxycodone.

uebernachtung guenstig in giessen

[...] Boeing officials say they are confident the 747 will retain a strong position worldwide, despite competition from McDonnell Douglas' MD-11 in 1990 and from Airbus Industrie's A340. Negotiation,recommend It provides an inside look at how the cigar...

Tags