mirror of
https://github.com/saltstack-formulas/timezone-formula.git
synced 2025-07-07 02:01:40 +02:00
Merge pull request #23 from myii/fix/ensure-all-platforms-pass-tests
fix: ensure formula works across all platforms
This commit is contained in:
commit
a201d088e1
38
.travis.yml
38
.travis.yml
@ -60,34 +60,40 @@ jobs:
|
|||||||
# the `platforms` defined in `kitchen.yml`
|
# the `platforms` defined in `kitchen.yml`
|
||||||
- env: INSTANCE=default-debian-10-master-py3
|
- env: INSTANCE=default-debian-10-master-py3
|
||||||
# - env: INSTANCE=default-ubuntu-1804-master-py3
|
# - env: INSTANCE=default-ubuntu-1804-master-py3
|
||||||
# - env: INSTANCE=default-centos-8-master-py3
|
- env: INSTANCE=default-centos-8-master-py3
|
||||||
# - env: INSTANCE=default-fedora-31-master-py3
|
# - env: INSTANCE=default-fedora-31-master-py3
|
||||||
# - env: INSTANCE=default-opensuse-leap-151-master-py3
|
# - env: INSTANCE=default-opensuse-leap-151-master-py3
|
||||||
# - env: INSTANCE=default-amazonlinux-2-master-py3
|
# - env: INSTANCE=default-amazonlinux-2-master-py3
|
||||||
# - env: INSTANCE=default-arch-base-latest-master-py2
|
# - env: INSTANCE=default-arch-base-latest-master-py2
|
||||||
|
# - env: INSTANCE=default-debian-10-3000-py3
|
||||||
|
- env: INSTANCE=default-ubuntu-1804-3000-py3
|
||||||
|
# - env: INSTANCE=default-centos-8-3000-py3
|
||||||
|
# - env: INSTANCE=default-fedora-31-3000-py3
|
||||||
|
- env: INSTANCE=default-opensuse-leap-151-3000-py3
|
||||||
|
- env: INSTANCE=default-amazonlinux-2-3000-py3
|
||||||
|
# - env: INSTANCE=default-arch-base-latest-3000-py2
|
||||||
# - env: INSTANCE=default-debian-10-2019-2-py3
|
# - env: INSTANCE=default-debian-10-2019-2-py3
|
||||||
# - env: INSTANCE=default-debian-9-2019-2-py3
|
# - env: INSTANCE=default-debian-9-2019-2-py3
|
||||||
- env: INSTANCE=default-ubuntu-1804-2019-2-py3
|
# - env: INSTANCE=default-ubuntu-1804-2019-2-py3
|
||||||
|
# - env: INSTANCE=default-ubuntu-1604-2019-2-py3
|
||||||
# - env: INSTANCE=default-centos-8-2019-2-py3
|
# - env: INSTANCE=default-centos-8-2019-2-py3
|
||||||
# - env: INSTANCE=default-fedora-31-2019-2-py3
|
# - env: INSTANCE=default-centos-7-2019-2-py3
|
||||||
- env: INSTANCE=default-opensuse-leap-151-2019-2-py3
|
- env: INSTANCE=default-fedora-31-2019-2-py3
|
||||||
# - env: INSTANCE=default-centos-7-2019-2-py2
|
# - env: INSTANCE=default-opensuse-leap-151-2019-2-py3
|
||||||
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
|
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
|
||||||
|
# - env: INSTANCE=default-ubuntu-1804-2019-2-py2
|
||||||
|
# - env: INSTANCE=default-amazonlinux-1-2019-2-py2
|
||||||
# - env: INSTANCE=default-arch-base-latest-2019-2-py2
|
# - env: INSTANCE=default-arch-base-latest-2019-2-py2
|
||||||
- env: INSTANCE=default-fedora-30-2018-3-py3
|
# - env: INSTANCE=default-centos-7-2018-3-py3
|
||||||
|
# - env: INSTANCE=default-fedora-30-2018-3-py3
|
||||||
# - env: INSTANCE=default-debian-9-2018-3-py2
|
# - env: INSTANCE=default-debian-9-2018-3-py2
|
||||||
|
# - env: INSTANCE=default-debian-8-2018-3-py2
|
||||||
|
# - env: INSTANCE=default-ubuntu-1804-2018-3-py2
|
||||||
# - env: INSTANCE=default-ubuntu-1604-2018-3-py2
|
# - env: INSTANCE=default-ubuntu-1604-2018-3-py2
|
||||||
# - env: INSTANCE=default-centos-7-2018-3-py2
|
# - env: INSTANCE=default-centos-6-2018-3-py2
|
||||||
# - env: INSTANCE=default-opensuse-leap-151-2018-3-py2
|
# - env: INSTANCE=default-opensuse-leap-151-2018-3-py2
|
||||||
- env: INSTANCE=default-amazonlinux-1-2018-3-py2
|
# - env: INSTANCE=default-amazonlinux-1-2018-3-py2
|
||||||
# - env: INSTANCE=default-arch-base-latest-2018-3-py2
|
- env: INSTANCE=default-arch-base-latest-2018-3-py2
|
||||||
# - env: INSTANCE=default-debian-8-2017-7-py2
|
|
||||||
# - env: INSTANCE=default-ubuntu-1604-2017-7-py2
|
|
||||||
- env: INSTANCE=default-centos-6-2017-7-py2
|
|
||||||
# - env: INSTANCE=default-fedora-30-2017-7-py2
|
|
||||||
# - env: INSTANCE=default-opensuse-leap-151-2017-7-py2
|
|
||||||
# - env: INSTANCE=default-amazonlinux-1-2017-7-py2
|
|
||||||
# - env: INSTANCE=default-arch-base-latest-2017-7-py2
|
|
||||||
|
|
||||||
## Define the release stage that runs `semantic-release`
|
## Define the release stage that runs `semantic-release`
|
||||||
- stage: 'release'
|
- stage: 'release'
|
||||||
|
90
kitchen.yml
90
kitchen.yml
@ -40,6 +40,35 @@ platforms:
|
|||||||
image: netmanagers/salt-master-py2:arch-base-latest
|
image: netmanagers/salt-master-py2:arch-base-latest
|
||||||
run_command: /usr/lib/systemd/systemd
|
run_command: /usr/lib/systemd/systemd
|
||||||
|
|
||||||
|
## SALT `3000`
|
||||||
|
- name: debian-10-3000-py3
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-3000-py3:debian-10
|
||||||
|
- name: ubuntu-1804-3000-py3
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-3000-py3:ubuntu-18.04
|
||||||
|
- name: centos-8-3000-py3
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-3000-py3:centos-8
|
||||||
|
- name: fedora-31-3000-py3
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-3000-py3:fedora-31
|
||||||
|
- name: opensuse-leap-151-3000-py3
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-3000-py3:opensuse-leap-15.1
|
||||||
|
run_command: /usr/lib/systemd/systemd
|
||||||
|
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
|
||||||
|
# => SCP did not finish successfully (255): (Net::SCP::Error)
|
||||||
|
transport:
|
||||||
|
max_ssh_sessions: 1
|
||||||
|
- name: amazonlinux-2-3000-py3
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-3000-py3:amazonlinux-2
|
||||||
|
- name: arch-base-latest-3000-py2
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-3000-py2:arch-base-latest
|
||||||
|
run_command: /usr/lib/systemd/systemd
|
||||||
|
|
||||||
## SALT `2019.2`
|
## SALT `2019.2`
|
||||||
- name: debian-10-2019-2-py3
|
- name: debian-10-2019-2-py3
|
||||||
driver:
|
driver:
|
||||||
@ -50,9 +79,15 @@ platforms:
|
|||||||
- name: ubuntu-1804-2019-2-py3
|
- name: ubuntu-1804-2019-2-py3
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2019.2-py3:ubuntu-18.04
|
image: netmanagers/salt-2019.2-py3:ubuntu-18.04
|
||||||
|
- name: ubuntu-1604-2019-2-py3
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-2019.2-py3:ubuntu-16.04
|
||||||
- name: centos-8-2019-2-py3
|
- name: centos-8-2019-2-py3
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2019.2-py3:centos-8
|
image: netmanagers/salt-2019.2-py3:centos-8
|
||||||
|
- name: centos-7-2019-2-py3
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-2019.2-py3:centos-7
|
||||||
- name: fedora-31-2019-2-py3
|
- name: fedora-31-2019-2-py3
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2019.2-py3:fedora-31
|
image: netmanagers/salt-2019.2-py3:fedora-31
|
||||||
@ -64,30 +99,44 @@ platforms:
|
|||||||
# => SCP did not finish successfully (255): (Net::SCP::Error)
|
# => SCP did not finish successfully (255): (Net::SCP::Error)
|
||||||
transport:
|
transport:
|
||||||
max_ssh_sessions: 1
|
max_ssh_sessions: 1
|
||||||
- name: centos-7-2019-2-py2
|
|
||||||
driver:
|
|
||||||
image: netmanagers/salt-2019.2-py2:centos-7
|
|
||||||
- name: amazonlinux-2-2019-2-py3
|
- name: amazonlinux-2-2019-2-py3
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2019.2-py3:amazonlinux-2
|
image: netmanagers/salt-2019.2-py3:amazonlinux-2
|
||||||
|
- name: ubuntu-1804-2019-2-py2
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-2019.2-py2:ubuntu-18.04
|
||||||
|
- name: amazonlinux-1-2019-2-py2
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-2019.2-py2:amazonlinux-1
|
||||||
|
run_command: /sbin/init
|
||||||
- name: arch-base-latest-2019-2-py2
|
- name: arch-base-latest-2019-2-py2
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2019.2-py2:arch-base-latest
|
image: netmanagers/salt-2019.2-py2:arch-base-latest
|
||||||
run_command: /usr/lib/systemd/systemd
|
run_command: /usr/lib/systemd/systemd
|
||||||
|
|
||||||
## SALT `2018.3`
|
## SALT `2018.3`
|
||||||
|
- name: centos-7-2018-3-py3
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-2018.3-py3:centos-7
|
||||||
- name: fedora-30-2018-3-py3
|
- name: fedora-30-2018-3-py3
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2018.3-py3:fedora-30
|
image: netmanagers/salt-2018.3-py3:fedora-30
|
||||||
- name: debian-9-2018-3-py2
|
- name: debian-9-2018-3-py2
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2018.3-py2:debian-9
|
image: netmanagers/salt-2018.3-py2:debian-9
|
||||||
|
- name: debian-8-2018-3-py2
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-2018.3-py2:debian-8
|
||||||
|
- name: ubuntu-1804-2018-3-py2
|
||||||
|
driver:
|
||||||
|
image: netmanagers/salt-2018.3-py2:ubuntu-18.04
|
||||||
- name: ubuntu-1604-2018-3-py2
|
- name: ubuntu-1604-2018-3-py2
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2018.3-py2:ubuntu-16.04
|
image: netmanagers/salt-2018.3-py2:ubuntu-16.04
|
||||||
- name: centos-7-2018-3-py2
|
- name: centos-6-2018-3-py2
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2018.3-py2:centos-7
|
image: netmanagers/salt-2018.3-py2:centos-6
|
||||||
|
run_command: /sbin/init
|
||||||
- name: opensuse-leap-151-2018-3-py2
|
- name: opensuse-leap-151-2018-3-py2
|
||||||
driver:
|
driver:
|
||||||
image: netmanagers/salt-2018.3-py2:opensuse-leap-15.1
|
image: netmanagers/salt-2018.3-py2:opensuse-leap-15.1
|
||||||
@ -105,37 +154,6 @@ platforms:
|
|||||||
image: netmanagers/salt-2018.3-py2:arch-base-latest
|
image: netmanagers/salt-2018.3-py2:arch-base-latest
|
||||||
run_command: /usr/lib/systemd/systemd
|
run_command: /usr/lib/systemd/systemd
|
||||||
|
|
||||||
## SALT `2017.7`
|
|
||||||
- name: debian-8-2017-7-py2
|
|
||||||
driver:
|
|
||||||
image: netmanagers/salt-2017.7-py2:debian-8
|
|
||||||
- name: ubuntu-1604-2017-7-py2
|
|
||||||
driver:
|
|
||||||
image: netmanagers/salt-2017.7-py2:ubuntu-16.04
|
|
||||||
- name: centos-6-2017-7-py2
|
|
||||||
driver:
|
|
||||||
image: netmanagers/salt-2017.7-py2:centos-6
|
|
||||||
run_command: /sbin/init
|
|
||||||
- name: fedora-30-2017-7-py2
|
|
||||||
driver:
|
|
||||||
image: netmanagers/salt-2017.7-py2:fedora-30
|
|
||||||
- name: opensuse-leap-151-2017-7-py2
|
|
||||||
driver:
|
|
||||||
image: netmanagers/salt-2017.7-py2:opensuse-leap-15.1
|
|
||||||
run_command: /usr/lib/systemd/systemd
|
|
||||||
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
|
|
||||||
# => SCP did not finish successfully (255): (Net::SCP::Error)
|
|
||||||
transport:
|
|
||||||
max_ssh_sessions: 1
|
|
||||||
- name: amazonlinux-1-2017-7-py2
|
|
||||||
driver:
|
|
||||||
image: netmanagers/salt-2017.7-py2:amazonlinux-1
|
|
||||||
run_command: /sbin/init
|
|
||||||
- name: arch-base-latest-2017-7-py2
|
|
||||||
driver:
|
|
||||||
image: netmanagers/salt-2017.7-py2:arch-base-latest
|
|
||||||
run_command: /usr/lib/systemd/systemd
|
|
||||||
|
|
||||||
provisioner:
|
provisioner:
|
||||||
name: salt_solo
|
name: salt_solo
|
||||||
log_level: debug
|
log_level: debug
|
||||||
|
@ -3,8 +3,13 @@
|
|||||||
---
|
---
|
||||||
timezone:
|
timezone:
|
||||||
name: Europe/Berlin
|
name: Europe/Berlin
|
||||||
|
tz_UTC: Etc/UTC
|
||||||
utc: true
|
utc: true
|
||||||
path_localtime: /etc/localtime
|
path_localtime: /etc/localtime
|
||||||
path_zoneinfo: /usr/share/zoneinfo/
|
path_zoneinfo: /usr/share/zoneinfo/
|
||||||
pkg:
|
pkg:
|
||||||
name: tzdata
|
name: tzdata
|
||||||
|
dbus:
|
||||||
|
pkg: dbus
|
||||||
|
service: dbus
|
||||||
|
run_service: true
|
||||||
|
@ -5,23 +5,44 @@
|
|||||||
{%- set tplroot = tpldir.split('/')[0] %}
|
{%- set tplroot = tpldir.split('/')[0] %}
|
||||||
{%- from tplroot ~ "/map.jinja" import timezone with context %}
|
{%- from tplroot ~ "/map.jinja" import timezone with context %}
|
||||||
|
|
||||||
|
{%- if grains.os not in ('MacOS', 'Windows') %}
|
||||||
|
timezone_packages:
|
||||||
|
{#- Work around bug in Salt for certain platforms where symlink isn't available #}
|
||||||
|
{%- if not salt['file.file_exists'](timezone.path_localtime) %}
|
||||||
|
file.symlink:
|
||||||
|
- name: {{ timezone.path_localtime }}
|
||||||
|
- target: {{ timezone.path_zoneinfo }}{{ timezone.tz_UTC }}
|
||||||
|
- force: true
|
||||||
|
- require_in:
|
||||||
|
# Required for unattended installation of the timezone package
|
||||||
|
- pkg: timezone_packages
|
||||||
|
# Required for timezone comparison (symlink must be present for checking the current timezone)
|
||||||
|
- timezone: timezone_setting
|
||||||
|
{%- endif %}
|
||||||
|
pkg.installed:
|
||||||
|
- name: {{ timezone.pkg.name }}
|
||||||
|
- require_in:
|
||||||
|
# Required for timezone comparison (current and proposed)
|
||||||
|
- timezone: timezone_setting
|
||||||
|
|
||||||
|
dbus_for_timezone:
|
||||||
|
pkg.installed:
|
||||||
|
- name: {{ timezone.dbus.pkg }}
|
||||||
|
- require_in:
|
||||||
|
- timezone: timezone_setting
|
||||||
|
{%- if timezone.dbus.run_service %}
|
||||||
|
service.running:
|
||||||
|
- name: {{ timezone.dbus.service }}
|
||||||
|
- enable: true
|
||||||
|
- require:
|
||||||
|
- pkg: dbus_for_timezone
|
||||||
|
- require_in:
|
||||||
|
# `dbus` is required for running `timedatectl`
|
||||||
|
- timezone: timezone_setting
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
timezone_setting:
|
timezone_setting:
|
||||||
timezone.system:
|
timezone.system:
|
||||||
- name: {{ timezone.name }}
|
- name: {{ timezone.name }}
|
||||||
- utc: {{ timezone.utc }}
|
- utc: {{ timezone.utc }}
|
||||||
|
|
||||||
{%- if grains.os not in ('MacOS', 'Windows') %}
|
|
||||||
|
|
||||||
timezone_packages:
|
|
||||||
pkg.installed:
|
|
||||||
- name: {{ timezone.pkg.name }}
|
|
||||||
|
|
||||||
timezone_symlink:
|
|
||||||
file.symlink:
|
|
||||||
- name: {{ timezone.path_localtime }}
|
|
||||||
- target: {{ timezone.path_zoneinfo }}{{ timezone.name }}
|
|
||||||
- force: true
|
|
||||||
- require:
|
|
||||||
- pkg: {{ timezone.pkg.name }}
|
|
||||||
|
|
||||||
{%- endif %}
|
|
||||||
|
@ -10,16 +10,34 @@
|
|||||||
# you will need to provide at least an empty dict in this file, e.g.
|
# you will need to provide at least an empty dict in this file, e.g.
|
||||||
# osfamilymap: {}
|
# osfamilymap: {}
|
||||||
---
|
---
|
||||||
|
Debian: {}
|
||||||
|
|
||||||
|
RedHat: {}
|
||||||
|
|
||||||
Suse:
|
Suse:
|
||||||
pkg:
|
pkg:
|
||||||
name: timezone
|
name: timezone
|
||||||
|
dbus:
|
||||||
FreeBSD:
|
pkg: dbus-1
|
||||||
pkg:
|
|
||||||
name: zoneinfo
|
|
||||||
|
|
||||||
Gentoo:
|
Gentoo:
|
||||||
pkg:
|
pkg:
|
||||||
name: sys-libs/timezone-data
|
name: sys-libs/timezone-data
|
||||||
|
|
||||||
|
Arch: {}
|
||||||
|
|
||||||
|
Alpine: {}
|
||||||
|
|
||||||
|
FreeBSD:
|
||||||
|
pkg:
|
||||||
|
name: zoneinfo
|
||||||
|
|
||||||
|
OpenBSD:
|
||||||
|
pkg:
|
||||||
|
name: zoneinfo
|
||||||
|
|
||||||
|
Solaris: {}
|
||||||
|
|
||||||
|
Windows: {}
|
||||||
|
|
||||||
MacOS: {}
|
MacOS: {}
|
||||||
|
@ -10,4 +10,42 @@
|
|||||||
# you will need to provide at least an empty dict in this file, e.g.
|
# you will need to provide at least an empty dict in this file, e.g.
|
||||||
# osfingermap: {}
|
# osfingermap: {}
|
||||||
---
|
---
|
||||||
osfingermap: {}
|
# os: Debian
|
||||||
|
Debian-10: {}
|
||||||
|
Debian-9: {}
|
||||||
|
Debian-8: {}
|
||||||
|
|
||||||
|
# os: Ubuntu
|
||||||
|
Ubuntu-18.04: {}
|
||||||
|
Ubuntu-16.04:
|
||||||
|
dbus:
|
||||||
|
run_service: false
|
||||||
|
|
||||||
|
# os: Fedora
|
||||||
|
Fedora-31: {}
|
||||||
|
Fedora-30: {}
|
||||||
|
|
||||||
|
# os: CentOS
|
||||||
|
CentOS Linux-8: {}
|
||||||
|
CentOS Linux-7: {}
|
||||||
|
CentOS-6:
|
||||||
|
dbus:
|
||||||
|
run_service: false
|
||||||
|
|
||||||
|
# os: Amazon
|
||||||
|
Amazon Linux-2: {}
|
||||||
|
Amazon Linux AMI-2018:
|
||||||
|
dbus:
|
||||||
|
run_service: false
|
||||||
|
|
||||||
|
# os: SUSE
|
||||||
|
Leap-15: {}
|
||||||
|
|
||||||
|
# os: FreeBSD
|
||||||
|
FreeBSD-12: {}
|
||||||
|
|
||||||
|
# os: Windows
|
||||||
|
Windows-8.1: {}
|
||||||
|
|
||||||
|
# os: Gentoo
|
||||||
|
Gentoo-2: {}
|
||||||
|
@ -10,4 +10,24 @@
|
|||||||
# you will need to provide at least an empty dict in this file, e.g.
|
# you will need to provide at least an empty dict in this file, e.g.
|
||||||
# osmap: {}
|
# osmap: {}
|
||||||
---
|
---
|
||||||
osmap: {}
|
# os_family: Debian
|
||||||
|
Ubuntu: {}
|
||||||
|
Raspbian: {}
|
||||||
|
|
||||||
|
# os_family: RedHat
|
||||||
|
Fedora: {}
|
||||||
|
CentOS: {}
|
||||||
|
Amazon: {}
|
||||||
|
|
||||||
|
# os_family: Suse
|
||||||
|
SUSE: {}
|
||||||
|
openSUSE: {}
|
||||||
|
|
||||||
|
# os_family: Gentoo
|
||||||
|
Funtoo: {}
|
||||||
|
|
||||||
|
# os_family: Arch
|
||||||
|
Manjaro: {}
|
||||||
|
|
||||||
|
# os_family: Solaris
|
||||||
|
SmartOS: {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user