{% set cron_day_spec = salt['pillar.get']('purge-old-kernels:cron_day_spec', '*/7') %}
{% set kernels_to_keep = salt['pillar.get']('purge-old-kernels:kernels_to_keep', 2) %}

include:
    - .
    - cronic


purge-old-kernels-cron:
    cron.present:
        - name: cronic /usr/local/bin/purge-old-kernels -y --keep {{ kernels_to_keep }}
        - identifier: purge-old-kernels-regularly
        - daymonth: '{{ cron_day_spec }}'


{% set cron_day_spec = salt['pillar.get']('purge-old-kernels:cron_day_spec', '*/7') %}
{% set kernels_to_keep = salt['pillar.get']('purge-old-kernels:kernels_to_keep', 2) %}

include:
    - purge-old-kernels
    - cronic


purge-old-kernels-cron:
    cron.present:
        - name: cronic /usr/local/bin/purge-old-kernels -y --keep {{ kernels_to_keep }}
        - identifier: purge-old-kernels-regularly
        - daymonth: '{{ cron_day_spec }}'


Add compatibility for old salt
purge-old-kernels: Add compatibility for old salt

At least salt==2015.8.1 seems to have trouble with fetching the root
state when specified as relative include, try this as a mitigation.

thusoy/salt-states,thusoy/salt-states,thusoy/salt-states,thusoy/salt-states