Przeglądaj źródła

Allow setting system locales

tags/2016.12
Filip Pytloun 8 lat temu
rodzic
commit
c49445a4f0
5 zmienionych plików z 41 dodań i 2 usunięć
  1. +12
    -0
      README.rst
  2. +3
    -0
      linux/map.jinja
  3. +1
    -1
      linux/system/init.sls
  4. +19
    -1
      linux/system/locale.sls
  5. +6
    -0
      tests/pillar/system.sls

+ 12
- 0
README.rst Wyświetl plik

@@ -153,6 +153,18 @@ Following will disallow dpkg to stop/start services for cassandra package automa
- package: '*'
action: switch

Set system locales:

.. code-block:: yaml

linux:
system:
locale:
en_US.UTF-8:
default: true
cs_CZ.UTF-8:
enabled: true

Kernel
~~~~~~


+ 3
- 0
linux/map.jinja Wyświetl plik

@@ -6,6 +6,7 @@
'group': {},
'job': {},
'limit': {},
'locale': {},
'motd': {},
'repo': {},
'package': {},
@@ -20,6 +21,7 @@
'group': {},
'job': {},
'limit': {},
'locale': {},
'motd': {},
'repo': {},
'package': {},
@@ -34,6 +36,7 @@
'group': {},
'job': {},
'limit': {},
'locale': {},
'motd': {},
'repo': {},
'package': {},

+ 1
- 1
linux/system/init.sls Wyświetl plik

@@ -12,7 +12,7 @@ include:
{%- if system.kernel is defined %}
- linux.system.kernel
{%- endif %}
{%- if system.locale is defined %}
{%- if system.locale|length > 0 %}
- linux.system.locale
{%- endif %}
{%- if system.prompt is defined %}

+ 19
- 1
linux/system/locale.sls Wyświetl plik

@@ -1,4 +1,22 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %}

{%- endif %}
{%- for locale_name, locale in system.locale.iteritems() %}
{%- if locale.get('enabled', True) %}

linux_locale_{{ locale_name }}:
locale.present:
- name: {{ locale_name }}

{%- if locale.get('default', False) %}
linux_locale_default:
locale.system:
- name: {{ locale_name }}
- require:
- locale: linux_locale_{{ locale_name }}
{%- endif %}

{%- endif %}
{%- endfor %}

{%- endif %}

+ 6
- 0
tests/pillar/system.sls Wyświetl plik

@@ -71,3 +71,9 @@ linux:
action: exit 101
- package: '*'
action: switch
locale:
en_US.UTF-8:
enabled: true
default: true
cs_CZ.UTF-8:
enabled: true

Ładowanie…
Anuluj
Zapisz