From f756de713e30c9139ad1404f057361154dea4e34 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 8 Aug 2016 20:07:40 +0200 Subject: [PATCH] Add locales module --- manifests/site.pp | 1 + modules/locales/manifests/init.pp | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 modules/locales/manifests/init.pp diff --git a/manifests/site.pp b/manifests/site.pp index 0c7fdf4..d8c9843 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1,6 +1,7 @@ node default { include stdlib class { 'ovh_cleanup': } + class { 'locales': } class { 'base_packages': } class { 'cron_puppet': } } diff --git a/modules/locales/manifests/init.pp b/modules/locales/manifests/init.pp new file mode 100644 index 0000000..d9a71fb --- /dev/null +++ b/modules/locales/manifests/init.pp @@ -0,0 +1,20 @@ +class locales { + file_line { '/etc/locale.gen#fr_FR.UTF-8': + path => '/etc/locale.gen', + line => 'fr_FR.UTF-8 UTF-8', + match => 'fr_FR.UTF-8 UTF-8$', + } + file_line { '/etc/locale.gen#en_US.UTF-8': + path => '/etc/locale.gen', + line => 'en_US.UTF-8 UTF-8', + match => 'en_US.UTF-8 UTF-8$', + } + exec { '/usr/bin/locale-gen': + subscribe => FileLine['/etc/locale.gen#fr_FR.UTF-8', '/etc/locale.gen#en_US.UTF-8'], + refreshonly => true, + } + exec { '/usr/bin/localectl set-locale LANG=fr_FR.UTF-8': + subscribe => FileLine['/etc/locale.gen#fr_FR.UTF-8'], + refreshonly => true, + } +} -- 2.41.0