mirror of
https://github.com/saltstack-formulas/timezone-formula.git
synced 2024-12-18 08:42:54 +01:00
4e881296c7
Added FORMULA for Salt Package Manager More detailed: https://docs.saltstack.com/en/latest/topics/spm/ install timezone pkg and update symlink based on osfamily bugfix in symlink function ...# another symlink bugfix testing changed variable-names in jinja according to https://github.com/ansible/ansible/issues/3907 added debian to mapfile changed function names for better looking code changed FORMULA according to contents of map.jinja, other distributions may follow added Redhat in map.jinja added Redhat in map.jinja added Redhat in map.jinja install timezone data containing pkg on several distros and symlink to the choosen timezone
23 lines
589 B
Plaintext
23 lines
589 B
Plaintext
# This state configures the timezone.
|
|
|
|
{%- set timezone = salt['pillar.get']('timezone:name', 'Europe/Berlin') %}
|
|
{%- set utc = salt['pillar.get']('timezone:utc', True) %}
|
|
{% from "timezone/map.jinja" import confmap with context %}
|
|
|
|
timezone_setting:
|
|
timezone.system:
|
|
- name: {{ timezone }}
|
|
- utc: {{ utc }}
|
|
|
|
timezone_packages:
|
|
pkg.installed:
|
|
- name: {{ confmap.pkgname }}
|
|
|
|
timezone_symlink:
|
|
file.symlink:
|
|
- name: {{ confmap.path_localtime }}
|
|
- target: {{ confmap.path_zoneinfo }}{{ timezone }}
|
|
- force: true
|
|
- require:
|
|
- pkg: {{ confmap.pkgname }}
|