Bläddra i källkod

Allow setting system locales

tags/2016.12
Filip Pytloun 8 år sedan
förälder
incheckning
c49445a4f0
5 ändrade filer med 41 tillägg och 2 borttagningar
  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 Visa fil

- package: '*' - package: '*'
action: switch action: switch


Set system locales:

.. code-block:: yaml

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

Kernel Kernel
~~~~~~ ~~~~~~



+ 3
- 0
linux/map.jinja Visa fil

'group': {}, 'group': {},
'job': {}, 'job': {},
'limit': {}, 'limit': {},
'locale': {},
'motd': {}, 'motd': {},
'repo': {}, 'repo': {},
'package': {}, 'package': {},
'group': {}, 'group': {},
'job': {}, 'job': {},
'limit': {}, 'limit': {},
'locale': {},
'motd': {}, 'motd': {},
'repo': {}, 'repo': {},
'package': {}, 'package': {},
'group': {}, 'group': {},
'job': {}, 'job': {},
'limit': {}, 'limit': {},
'locale': {},
'motd': {}, 'motd': {},
'repo': {}, 'repo': {},
'package': {}, 'package': {},

+ 1
- 1
linux/system/init.sls Visa fil

{%- if system.kernel is defined %} {%- if system.kernel is defined %}
- linux.system.kernel - linux.system.kernel
{%- endif %} {%- endif %}
{%- if system.locale is defined %}
{%- if system.locale|length > 0 %}
- linux.system.locale - linux.system.locale
{%- endif %} {%- endif %}
{%- if system.prompt is defined %} {%- if system.prompt is defined %}

+ 19
- 1
linux/system/locale.sls Visa fil

{%- from "linux/map.jinja" import system with context %} {%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %} {%- 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 Visa fil

action: exit 101 action: exit 101
- package: '*' - package: '*'
action: switch action: switch
locale:
en_US.UTF-8:
enabled: true
default: true
cs_CZ.UTF-8:
enabled: true

Laddar…
Avbryt
Spara