puppet-elasticsearch
puppet-elasticsearch copied to clipboard
When using a filesystem path for template source, cannot depend on another resource that provides that file.
Hi there,
module version: 6.4.0 puppet version: 6.4.2
If I use the following resource:
elasticsearch::template { 'barry':
source => '/etc/logstash/mappings/barry.json',
subscribe => Package['barry'],
}
or
elasticsearch::template { 'barry':
source => '/etc/logstash/mappings/barry.json',
require => Package['barry'],
}
I get the following error:
Info: Using configured environment 'prod'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for boxy
Error: Failed to apply catalog: Validation of Elasticsearch_template[barry] failed: Could not retrieve source /etc/logstash/mappings/barry.json (file: /etc/puppetlabs/code/environments/prod/modules/elasticsearch/manifests/template.pp, line: 86)
The 'barry' package provides the template file. I'm not sure why I'm getting this error, and it could be an issue with Puppet rather than your plugin. I'm wondering if maybe your template type/provider somehow needs that file to exist in some earlier stage of the puppet run (prior to the package being installed)?
EDIT I have also found that modifications to the mappings file on disk are not picked up by the type/provider and applied to ES.
Any thoughts?
Thanks! Nick