Commit 9e40b2d1 authored by Scotty Logan's avatar Scotty Logan
Browse files

trying to fix locale for centos

parent be871577
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@
# really generic defaults
---
base::timezone: PST8PDT
base::locale: en_US.UTF-8
base::lang: en_US
base::charset: UTF-8
base::locale: "%{base::lang}.%{base::charset}"
base::packages::docker_package: docker
base::packages::install:
  - bash
+30 −11
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@
class base (
  $timezone,
  $locale,
  $lang,
  $charset,
  $sources,
  $package_type
) {
@@ -78,6 +80,7 @@ class base (
    source => "puppet:///modules/${module_name}/etc/default/locale",
  }

  if ($::osfamily == 'Debian') {
    file { '/etc/locale.gen':
      ensure  => file,
      owner   => 'root',
@@ -91,5 +94,21 @@ class base (
      subscribe   => File['/etc/locale.gen'],
      refreshonly => true,
    }
  }

  if ($::osfamily == 'RedHat') {
    file { '/etc/locale.conf':
      ensure  => file,
      owner   => 'root',
      group   => 'root',
      mode    => '0444',
      content => "LANG=\"${locale}\"",
    }

    exec { 'locale-def':
      command     => "/usr/bin/localedef -v -c -i ${lang} -f ${charset} ${locale}",
      subscribe   => File['/etc/locale.conf'],
      refreshonly => true,
    }
  }
}