forked from daschatten/locale-formula
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from babilen/dev-std-formula-layout
Switch to standard formula layout
- Loading branch information
Showing
3 changed files
with
29 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
locale: | ||
config: '/etc/locale.conf' | ||
pkgs: [] | ||
present: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
# Installs and configures system locales | ||
|
||
{% from "locale/map.jinja" import map with context %} | ||
{% from "locale/map.jinja" import locale with context %} | ||
{% if locale.pkgs is iterable %} | ||
locale_pkgs: | ||
pkg.installed: | ||
- pkgs: | ||
{%- for pkg in map.pkgs %} | ||
{%- for pkg in locale.pkgs %} | ||
- {{ pkg }} | ||
{% endfor %} | ||
{% endif %} | ||
{%- set locales = salt['pillar.get']('locale:present', []) %} | ||
{%- set default = salt['pillar.get']('locale:default', 'en_US.UTF-8') %} | ||
{%- for locale in locales %} | ||
locale_present_{{ locale|replace('.', '_')|replace(' ', '_') }}: | ||
{%- for l in locale.present %} | ||
locale_present_{{ l|replace('.', '_')|replace(' ', '_') }}: | ||
locale.present: | ||
- name: {{ locale }} | ||
- name: {{ l }} | ||
{%- endfor %} | ||
{% if default is mapping %} | ||
{% if locale.default is defined %} | ||
locale_default: | ||
locale.system: | ||
- name: {{ default.name }} | ||
- name: {{ locale.default.name }} | ||
- require: | ||
- locale: locale_present_{{ default.requires|replace('.', '_')|replace(' ', '_') }} | ||
- locale: locale_present_{{ locale.default.requires|replace('.', '_')|replace(' ', '_') }} | ||
{% endif %} | ||
{%- set conf = salt['pillar.get']('locale:conf', {}) %} | ||
{%- if conf %} | ||
locale-conf-is-setup: | ||
{%- if locale.conf is defined %} | ||
locale_conf: | ||
file.managed: | ||
- name: /etc/locale.conf | ||
- name: {{ locale.config }} | ||
- contents_pillar: locale:conf | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters