From 9896138f495d7c53fa8bc0fe3f8c74abf458ee6c Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Feb 09 2020 23:14:41 +0000 Subject: Enable etckeeper.timer only on >= 15.x Older releases have a cronjob instead of the service file. Note: Technically the if condition is slightly wrong because it doesn't exclude 42.x. Given the small amount of remaining 42.x VMs, I'd say we can ignore this detail ;-) --- diff --git a/salt/profile/etckeeper/init.sls b/salt/profile/etckeeper/init.sls index 93ec074..38462e4 100644 --- a/salt/profile/etckeeper/init.sls +++ b/salt/profile/etckeeper/init.sls @@ -1,3 +1,5 @@ +{% set osmajorrelease = salt['grains.get']('osmajorrelease')|int %} + etckeeper_install: pkg.installed: - pkgs: @@ -9,7 +11,9 @@ etckeeper_init: - name: etckeeper init - creates: /etc/.git +{% if osmajorrelease > 12 %} etckeeper_timer: service.running: - name: etckeeper.timer - enable: True +{% endif %}