On 10/13/2015 05:07 PM, R.I.Pienaar wrote:
> You can test all your yamls like:
>
> for i in $(find /etc/puppetlabs/code/hieradb -name \*.yaml)
> do
> /opt/puppetlabs/puppet/bin/ruby -r yaml -e "YAML.load(File.read('$i')) && puts('$i: OK') rescue puts('$i: NOT OK')"
> done
>
> change /etc/puppetlabs/code/hieradb to your hiera dir
Yeah that's it!
I've fixed my yamls and everything is fine on that ground now.
But, I have new issues:
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: Evaluation Error: Error while evaluating a Function Call,
undefined method `sub' for
Logstash::Configfile[]{:name=>""}:Puppet::Resource at
/etc/puppetlabs/code/environments/production/modules/helpers/manifests/logstash.pp:19:28
on node xxx
This is the snippet:
include ::logstash
# load configs from hiera
$logstash_configs = hiera_hash('logstash::configfiles', undef)
if ($logstash_configs) { create_resources(::Logstash::Configfile,
$logstash_configs) }
$logstash_patterns = hiera_hash('logstash::patternfiles', undef)
if ($logstash_patterns) { create_resources(::Logstash::Patternfile,
$logstash_patterns) }
And this is from hiera:
logstash::configfiles:
'input_header':
content: "input {\n"
order: 11
'input_postfix':
template: 'helpers/logstash/inputs/mongodb.erb'
order: 12
...
I have general problem with importing hashes from yaml in manifests...
It's bombing out on other stuff too...