locale: Initial version of module.

This commit is contained in:
Timo Mkinen 2013-05-14 23:59:01 +03:00
parent 423fadfc11
commit 8b7292d6f6

45
locale/manifests/init.pp Normal file
View file

@ -0,0 +1,45 @@
# Set system locale
#
# === Parameters
#
# $lang:
# Value to set into $LANG environment.
#
# === Sample usage
#
# class { "locale":
# lang => "en_US.ISO8859-1",
# }
#
class locale($lang="en_US") {
case $::operatingsystem {
"centos": {
augeas { "i18n":
context => "/files/etc/sysconfig/i18n",
changes => "set LANG en_US",
}
}
"fedora": {
augeas { "i18n":
context => $::operatingsystemrelease ? {
/^1[0-7]/ => "/files/etc/sysconfig/i18n",
default => "/files/etc/locale.conf",
},
changes => "set LANG en_US",
}
}
"ubuntu": {
augeas { "i18n":
context => "/files/etc/default/locale",
changes => "set LANG en_US",
}
}
default: {
fail("locale module not supported in ${::operatingsystem}")
}
}
}