locale: Initial version of module.
This commit is contained in:
parent
423fadfc11
commit
8b7292d6f6
1 changed files with 45 additions and 0 deletions
45
locale/manifests/init.pp
Normal file
45
locale/manifests/init.pp
Normal 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}")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue