install timezone pkg and update symlink based on osfamily

This commit is contained in:
Thorsten Bro 2016-09-28 16:14:08 +02:00
parent d13d7c71ce
commit 3fb41ca3b8
2 changed files with 20 additions and 0 deletions

View File

@ -2,8 +2,19 @@
{%- set timezone = salt['pillar.get']('timezone:name', 'Europe/Berlin') %} {%- set timezone = salt['pillar.get']('timezone:name', 'Europe/Berlin') %}
{%- set utc = salt['pillar.get']('timezone:utc', True) %} {%- set utc = salt['pillar.get']('timezone:utc', True) %}
{% from "timezone/map.jinja" import confmap with context %}
timezone_setting: timezone_setting:
timezone.system: timezone.system:
- name: {{ timezone }} - name: {{ timezone }}
- utc: {{ utc }} - utc: {{ utc }}
timezone.packages:
pkg.installed:
- name: {{ confmap.pkgname }}
{{ confmap.path-localtime }}:
file.symlink:
- target: {{ path-zoneinfo }}{{ timezone }}
- require:
- pkg: {{ confmap.pkgname }}

9
timezone/map.jinja Normal file
View File

@ -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) %}