local glob

This commit is contained in:
Leif Johansson 2020-03-30 16:24:26 +02:00
parent 99f1eb51a5
commit 19b998444d
No known key found for this signature in database
GPG key ID: D73AD6430AD478D6
2 changed files with 6 additions and 1 deletions

View file

@ -11,7 +11,7 @@ class eid::telegraf(String $version = "stable") {
notify => Sunet::Docker_run['telegraf']
}
Dir(["/etc/telegraf/telegraf.conf.d/*.conf"]).each |Integer $index, String $file| {
eid_glob(["/etc/telegraf/telegraf.conf.d/*.conf"]).each |Integer $index, String $file| {
concat::fragment { $file:
target => "/etc/telegraf/telegraf.conf",
source => $file,

View file

@ -0,0 +1,5 @@
module Puppet::Parser::Functions
newfunction(:eid_glob, :type => :rvalue) do |args|
return Dir.glob(args[0]);
end
end