I haven't done it, but in your situation I would do something generically like this:
ls | create_yaml_array.rb >/path/to/hiera/nodes/myserver.yaml
---
cats:
concat1:
bits:
- bit1
- bit2
- bit3
path: '/path/to/file1'
Then add a define somewhere to use with create_resources(), and inside that define have each resource notify your exec. That way if any resources are created/updated they'll fire off the exec. You'll need to build in ensure=>absent support in the define, of course.
define ($bits, $path) {
file_concat { $title:
ensure => present,
# other stuff here
}
exec { 'allow_input_file_read':
command => "/usr/bin/setfacl -R -m u:logstash:rwx ${path}",
subscribe => File_concat[$title],
refreshonly => true,
}
}
Not a good example since I haven't used file_concat or logstash myself, but that's where I'd start.
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [1]
puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> [2]
https://groups.google.com/d/msgid/puppet-users/fdd179e7-a3e4-4819-9173-b749d2540121%40googlegroups.com.
> For more options, visit [3]
https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. mailto:
puppet-users...@googlegroups.com
> 2.
https://groups.google.com/d/msgid/puppet-users/fdd179e7-a3e4-4819-9173-b749d2540121%40googlegroups.com?utm_medium=email&utm_source=footer
> 3.
https://groups.google.com/d/optout