Skip to content

Commit

Permalink
Re-add check to make sure array isn't empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jhooyberghs committed Dec 5, 2017
1 parent deb8216 commit 87124c1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions manifests/alerts.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@
#
class prometheus::alerts (
String $location,
Variant[Array,Hash] $alerts = {},
Variant[Array,Hash] $alerts,
String $alertfile_name = 'alert.rules'
) inherits prometheus::params {

if ( versioncmp($::prometheus::version, '2.0.0') < 0 ){

file { "${location}/${alertfile_name}":
ensure => 'file',
owner => $prometheus::user,
group => $prometheus::group,
notify => Class['::prometheus::service_reload'],
content => epp("${module_name}/alerts.epp"),
if $alerts != [] {

file { "${location}/${alertfile_name}":
ensure => 'file',
owner => $prometheus::user,
group => $prometheus::group,
notify => Class['::prometheus::service_reload'],
content => epp("${module_name}/alerts.epp"),
}

}

}
Expand Down

0 comments on commit 87124c1

Please sign in to comment.