Merge pull request #1 from thomic/master
automatically install timezone packages and set symlink to localtime-file
This commit is contained in:
commit
8d310cd9d3
4
FORMULA
4
FORMULA
|
@ -1,6 +1,6 @@
|
|||
name: timezone
|
||||
os: RedHat, Debian, Ubuntu, Suse, FreeBSD
|
||||
os_family: RedHat, Debian, Suse, FreeBSD
|
||||
os: Debian, RedHat, Suse
|
||||
os_family: Debian, RedHat, Suse
|
||||
version: 201504
|
||||
release: 1
|
||||
minimum_version: 2015.5
|
||||
|
|
|
@ -2,8 +2,21 @@
|
|||
|
||||
{%- 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 }}
|
||||
|
||||
timezone_symlink:
|
||||
file.symlink:
|
||||
- name: {{ confmap.path_localtime }}
|
||||
- target: {{ confmap.path_zoneinfo }}{{ timezone }}
|
||||
- force: true
|
||||
- require:
|
||||
- pkg: {{ confmap.pkgname }}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{% set map = {
|
||||
'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',
|
||||
},
|
||||
} %}
|
||||
|
||||
{% set confmap = map.get(grains.os_family) %}
|
Loading…
Reference in New Issue