Showing with 9 additions and 9 deletions.
  1. +4 −4 manifests/pe_metric.pp
  2. +1 −1 metadata.json
  3. +4 −0 templates/find_cron.epp
  4. +0 −4 templates/tidy_apply.epp
8 changes: 4 additions & 4 deletions manifests/pe_metric.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
String $metrics_type = $title,
Array[String] $hosts = [ '127.0.0.1' ],
String $cron_minute = '*/5',
String $tidy_age = '3d',
Integer $retention_days = 3,
) {

$metrics_output_dir = "${output_dir}/${metrics_type}"
Expand Down Expand Up @@ -34,9 +34,9 @@

cron { "${metrics_type}_metrics_tidy" :
ensure => $metric_ensure,
command => epp("pe_metric_curl_cron_jobs/tidy_apply.epp",
{ 'output_dir' => $metrics_output_dir,
'tidy_age' => $tidy_age,
command => epp("pe_metric_curl_cron_jobs/find_cron.epp",
{ 'output_dir' => $metrics_output_dir,
'retention_days' => $retention_days,
}),
user => 'root',
hour => '2',
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npwalker/pe_metric_curl_cron_jobs",
"version": "1.1.1",
"version": "2.0.0",
"author": "npwalker",
"summary": "A Module for setting up cron jobs to curl metrics from PE components",
"license": "Apache-2.0",
Expand Down
4 changes: 4 additions & 0 deletions templates/find_cron.epp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<%- | String $output_dir,
Integer $retention_days,
| -%>
find '<%= $output_dir %>' -type f -mtime <%= $retention_days %> -delete -print
4 changes: 0 additions & 4 deletions templates/tidy_apply.epp

This file was deleted.