diff --git a/timezone/init.sls b/timezone/init.sls index facd463..b3e01c7 100644 --- a/timezone/init.sls +++ b/timezone/init.sls @@ -2,8 +2,19 @@ {%- 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 }} + +{{ confmap.path-localtime }}: + file.symlink: + - target: {{ path-zoneinfo }}{{ timezone }} + - require: + - pkg: {{ confmap.pkgname }} diff --git a/timezone/map.jinja b/timezone/map.jinja new file mode 100644 index 0000000..49bef33 --- /dev/null +++ b/timezone/map.jinja @@ -0,0 +1,9 @@ +{% set map = { + 'Suse': { + 'path-localtime': '/etc/localtime', + 'path-zoneinfo': '/usr/share/zoneinfo/', + 'pkgname': 'timezone', + }, +} %} + +{% set confmap = map.get(grains.os_family) %}