Skip to content

Commit

Permalink
(SIMP-5012) Allow cron command to be customized (#37)
Browse files Browse the repository at this point in the history
SIMP-5012 #close
  • Loading branch information
treydock authored and trevor-vaughan committed Jul 12, 2018
1 parent dc49c8a commit bfb8256
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Thu Jul 12 2018 Trey Dockendorf <[email protected]> - 6.1.3-0
- Add `aide::cron_command` to allow user modification.
- Ensure that the package is explicitly installed before any dependent
resources.

Expand Down
10 changes: 7 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,21 @@
# @param minute
# ``minute`` cron parameter for when the AIDE check is run
#
# @param hour
# @param hour
# ``hour`` cron parameter for when the AIDE check is run
#
# @param monthday
# @param monthday
# ``monthday`` cron parameter for when the AIDE check is run
#
# @param month
# @param month
# ``month`` cron parameter for when the AIDE check is run
#
# @param weekday
# ``weekday`` cron parameter for when the AIDE check is run
#
# @param cron_command
# ``command`` cron parameter for when AIDE check is run
#
# @param default_rules
# A set of default rules to include. If this is set, the internal
# defaults will be overridden.
Expand Down Expand Up @@ -106,6 +109,7 @@
Variant[Enum['*'],Stdlib::Compat::Integer] $monthday = '*',
Variant[Enum['*'],Stdlib::Compat::Integer] $month = '*',
Stdlib::Compat::Integer $weekday = 0,
String $cron_command = '/bin/nice -n 19 /usr/sbin/aide -C',
String $default_rules = '', # lint:ignore:empty_string_assignment
Boolean $logrotate = simplib::lookup('simp_options::logrotate', { 'default_value' => false}),
Aide::Rotateperiod $rotate_period = 'weekly',
Expand Down
6 changes: 4 additions & 2 deletions manifests/set_schedule.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# @param monthday ``monthday`` cron parameter
# @param month ``month`` cron parameter
# @param weekday ``weekday`` cron parameter
# @param command ``command`` cron parameter
#
# @author https://github.com/simp/pupmod-simp-aide/graphs/contributors
#
Expand All @@ -15,7 +16,8 @@
Stdlib::Compat::Integer $hour = $::aide::hour,
Variant[Enum['*'],Stdlib::Compat::Integer] $monthday = $::aide::monthday,
Variant[Enum['*'],Stdlib::Compat::Integer] $month = $::aide::month,
Stdlib::Compat::Integer $weekday = $::aide::weekday
Stdlib::Compat::Integer $weekday = $::aide::weekday,
String $command = $::aide::cron_command,
) {
assert_private()

Expand All @@ -24,7 +26,7 @@
validate_between($weekday, 0, 7)

cron { 'aide_schedule':
command => '/bin/nice -n 19 /usr/sbin/aide -C',
command => $command,
user => 'root',
minute => $minute,
hour => $hour,
Expand Down

0 comments on commit bfb8256

Please sign in to comment.