From 7fed35a408b9ec37454169425823785b5fc8978b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 24 Aug 2017 02:22:17 +0200 Subject: Refactor base installation module --- modules/base_installation/manifests/locales.pp | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 modules/base_installation/manifests/locales.pp (limited to 'modules/base_installation/manifests/locales.pp') 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 @@ +class base_installation::locales inherits base_installation { + # Note: we don't care about other lines, they are not handled in + # Puppet + define locale_line ($locale, $charmap = 'UTF-8') { + file_line { "/etc/locale.gen#$locale": + path => '/etc/locale.gen', + line => "$locale $charmap ", + match => "#?$locale $charmap +$", + notify => Exec["/usr/bin/locale-gen"], + } + } + + unless empty($base_installation::system_locales) { + $base_installation::system_locales.each |$locale| { + base_installation::locales::locale_line { "/etc/locale.gen#$locale": + locale => $locale + } + } + + $main_locale = $base_installation::system_locales[0] + exec { "set_main_locale": + command => "/usr/bin/systemd-firstboot --locale=$main_locale", + creates => "/etc/locale.conf", + } + } + + exec { '/usr/bin/locale-gen': + refreshonly => true, + } + + + file { "/etc/vconsole.conf": + ensure => "link", + target => "/dev/null", + } + +} -- cgit v1.2.3