Puppet Class: profile::locales::extended

Defined in:
modules/profile/manifests/locales/extended.pp

Overview



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'modules/profile/manifests/locales/extended.pp', line 8

class profile::locales::extended {

    package { 'locales':
        ensure => present,
    }

    exec { 'locale-gen':
        command     => '/usr/sbin/locale-gen --purge',
        refreshonly => true,
        require     => Package['locales'],
    }

    # Ubuntu has a nice supported.d mechanism; Debian doesn't, so fall back
    # into overwriting the systems config. For Debian systems, though,
    # locales::all might be a better option, depending on the use case.
    $localeconf = $::operatingsystem ? {
        'Ubuntu' => '/var/lib/locales/supported.d/local',
        'Debian' => '/etc/locale.gen',
        default  => '/etc/locale.gen',
    }

    file { $localeconf:
        ensure => present,
        source => 'puppet:///modules/profile/locales/locales-extended',
        owner  => 'root',
        group  => 'root',
        mode   => '0444',
        notify => Exec['locale-gen'],
    }
}