mirror of
https://github.com/saltstack-formulas/timezone-formula.git
synced 2024-11-28 03:27:59 +01:00
27 lines
656 B
Plaintext
27 lines
656 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 }}
|
|
|
|
{%- if grains.os not in ('MacOS', 'Windows') %}
|
|
|
|
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 }}
|
|
|
|
{%- endif %}
|