0
0
mirror of https://github.com/saltstack-formulas/timezone-formula.git synced 2024-11-27 23:07:47 +01:00
This commit is contained in:
N 2019-06-16 23:50:26 +01:00
commit 1e5eb0b53f
No known key found for this signature in database
GPG Key ID: 55A292EAB4E54067
3 changed files with 24 additions and 30 deletions

3
timezone/defaults.yaml Normal file
View File

@ -0,0 +1,3 @@
path_localtime: /etc/localtime
path_zoneinfo: /usr/share/zoneinfo/
pkgname: tzdata

View File

@ -1,31 +1,15 @@
{% set map = {
'MacOS': {
},
'Debian': {
'path_localtime': '/etc/localtime',
'path_zoneinfo': '/usr/share/zoneinfo/',
'pkgname': 'tzdata',
},
'RedHat': {
'path_localtime': '/etc/localtime',
'path_zoneinfo': '/usr/share/zoneinfo/',
'pkgname': 'tzdata',
},
'Suse': {
'path_localtime': '/etc/localtime',
'path_zoneinfo': '/usr/share/zoneinfo/',
'pkgname': 'timezone',
},
'Arch': {
'path_localtime': '/etc/localtime',
'path_zoneinfo': '/usr/share/zoneinfo/',
'pkgname': 'tzdata',
},
'FreeBSD': {
'path_localtime': '/etc/localtime',
'path_zoneinfo': '/usr/share/zoneinfo/',
'pkgname': 'zoneinfo',
},
} %}
{% import_yaml "timezone/defaults.yaml" as defaults %}
{% import_yaml "timezone/osfamilymap.yaml" as osfamilymap %}
{% set confmap = map.get(grains.os_family) %}
{% set osfam = salt['grains.filter_by'](
osfamilymap,
grain='os_family'
) or {} %}
{% do salt['defaults.merge'](defaults, osfam) %}
{%- set confmap = salt['pillar.get'](
'timezone:lookup',
default=defaults,
merge=True,
) %}

View File

@ -0,0 +1,7 @@
Suse:
pkgname: timezone
FreeBSD:
pkgname: zoneinfo
Gentoo:
pkgname: sys-libs/timezone-data
MacOS: {}