Skip to content

Instantly share code, notes, and snippets.

@chadh
Last active July 11, 2018 02:10
Show Gist options
  • Select an option

  • Save chadh/8a4cae01b338e567708b0043cebc99f6 to your computer and use it in GitHub Desktop.

Select an option

Save chadh/8a4cae01b338e567708b0043cebc99f6 to your computer and use it in GitHub Desktop.
reduce bug
$t = @(EOF)
<%=
# remove dynamic facts and class params
$facts.reduce( {} ) | $memo, $entry | {
if $entry[0] !~ /^(server.*|facts|system_uptime|uptime.*|rubysitedir|_timestamp|memoryfree.*|swapfree.*|.*temperature.*|hpraid.*|hparray.*power_on_hours|hparray.*estimated_life_remaining_based_on_workload_to_date|title|name|caller_module_name|module_name|lib|path|packages|version|mysql_instances|ilo_facterfile_age|ilo_ipv6_.*|sshfp_.*|environment|clientnoop)$/ {
$memo + { $entry[0] => $entry[1] }
}
}
%>
EOF
file { '/tmp/foo_out':
content => inline_epp($t),
}
[chadh:/tmp] % /opt/puppetlabs/bin/puppet apply --verbose /tmp/bar.pp
Error: Evaluation Error: The value '' cannot be converted to Numeric. at inlined-epp-text:5:9 on node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment