aboutsummaryrefslogtreecommitdiff
path: root/modules/base_installation/manifests/locales.pp
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2017-08-24 02:22:17 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2017-08-29 22:46:14 +0200
commit7fed35a408b9ec37454169425823785b5fc8978b (patch)
tree28371d43ac304f99fb0a5305124858db69ef2137 /modules/base_installation/manifests/locales.pp
parentba2cf1b5d938810077b0fd73844faf432e8e8f9d (diff)
downloadPuppet-7fed35a408b9ec37454169425823785b5fc8978b.tar.gz
Puppet-7fed35a408b9ec37454169425823785b5fc8978b.tar.zst
Puppet-7fed35a408b9ec37454169425823785b5fc8978b.zip
Refactor base installation module
Diffstat (limited to 'modules/base_installation/manifests/locales.pp')
-rw-r--r--modules/base_installation/manifests/locales.pp37
1 files changed, 37 insertions, 0 deletions
diff --git a/modules/base_installation/manifests/locales.pp b/modules/base_installation/manifests/locales.pp
new file mode 100644
index 0000000..0f31e0b
--- /dev/null
+++ b/modules/base_installation/manifests/locales.pp
@@ -0,0 +1,37 @@
1class base_installation::locales inherits base_installation {
2 # Note: we don't care about other lines, they are not handled in
3 # Puppet
4 define locale_line ($locale, $charmap = 'UTF-8') {
5 file_line { "/etc/locale.gen#$locale":
6 path => '/etc/locale.gen',
7 line => "$locale $charmap ",
8 match => "#?$locale $charmap +$",
9 notify => Exec["/usr/bin/locale-gen"],
10 }
11 }
12
13 unless empty($base_installation::system_locales) {
14 $base_installation::system_locales.each |$locale| {
15 base_installation::locales::locale_line { "/etc/locale.gen#$locale":
16 locale => $locale
17 }
18 }
19
20 $main_locale = $base_installation::system_locales[0]
21 exec { "set_main_locale":
22 command => "/usr/bin/systemd-firstboot --locale=$main_locale",
23 creates => "/etc/locale.conf",
24 }
25 }
26
27 exec { '/usr/bin/locale-gen':
28 refreshonly => true,
29 }
30
31
32 file { "/etc/vconsole.conf":
33 ensure => "link",
34 target => "/dev/null",
35 }
36
37}