0
0
mirror of https://github.com/saltstack-formulas/timezone-formula.git synced 2024-12-01 02:31:12 +01:00
timezone-formula/timezone/init.sls

27 lines
656 B
Plaintext
Raw Permalink Normal View History

2015-04-25 11:04:14 +02:00
# 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 %}
2015-04-25 11:04:14 +02:00
timezone_setting:
timezone.system:
- name: {{ timezone }}
- utc: {{ utc }}
2019-06-11 13:58:29 +02:00
{%- 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 }}
2019-06-11 13:58:29 +02:00
{%- endif %}