diff --git a/.travis.yml b/.travis.yml index 4cf7de7..55c36b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ jobs: # - env: INSTANCE=default-fedora-30-2019-2-py3 # - env: INSTANCE=default-opensuse-leap-15-2019-2-py3 - env: INSTANCE=default-amazonlinux-2-2019-2-py2 - # - env: INSTANCE=default-arch-base-latest-2019-2-py2 + - env: INSTANCE=default-arch-base-latest-2019-2-py2 # - env: INSTANCE=default-debian-9-2018-3-py2 # - env: INSTANCE=default-ubuntu-1604-2018-3-py2 # - env: INSTANCE=default-centos-7-2018-3-py2 diff --git a/cron/defaults.yaml b/cron/defaults.yaml index 2b0646b..5f33b14 100644 --- a/cron/defaults.yaml +++ b/cron/defaults.yaml @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- # vim: ft=yaml --- -cron: {} +cron: + pkg: cronie + service: cron diff --git a/cron/osfamilymap.yaml b/cron/osfamilymap.yaml index 733daa0..dc131b4 100644 --- a/cron/osfamilymap.yaml +++ b/cron/osfamilymap.yaml @@ -12,12 +12,11 @@ --- Debian: pkg: cron - service: cron RedHat: - pkg: cronie service: crond -Suse: - pkg: cronie - service: cron +Suse: {} + +Arch: + service: cronie diff --git a/pillar.example b/pillar.example index 7e4d0d0..780bebd 100644 --- a/pillar.example +++ b/pillar.example @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml --- cron: enabled: true # Default diff --git a/test/integration/default/controls/service_spec.rb b/test/integration/default/controls/service_spec.rb index 2ac8f7f..3f675f5 100644 --- a/test/integration/default/controls/service_spec.rb +++ b/test/integration/default/controls/service_spec.rb @@ -7,6 +7,14 @@ control 'Cron service' do case os[:family] when 'debian', 'suse' 'cron' + # Catch remaining `linux` platforms to identify by `name` at the end + when 'linux' + case os[:name] + when 'arch' + 'cronie' + else + 'crond' + end else 'crond' end diff --git a/test/salt/pillar/cron.sls b/test/salt/pillar/cron.sls index 15860f9..bad5a78 100644 --- a/test/salt/pillar/cron.sls +++ b/test/salt/pillar/cron.sls @@ -1,2 +1,35 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml --- -cron: {} +cron: + enabled: true # Default + tasks: + task1: + type: present # Default + name: echo test > /tmp/test + user: root + minute: 0 + hour: 0 + daymonth: 7 + month: 1 + dayweek: 6 + comment: comment1 + task2: + type: absent # To remove that crontask + name: echo task2 > /tmp/test2 + user: root + minute: random + hour: 1 + task3: + type: absent + name: echo task3 > /tmp/test3 + user: root + special: '@hourly' + comment: comment3 + task4: + type: present # run every 5 minutes + name: echo task4 > /tmp/test4 + user: root + minute: '*/5' + hour: '*' + comment: comment4