Hi Lars, [...] > It would be nice for a plain Integer (Fixnum) to work as well when > it's coming from a YAML file.
When you introduce a numeric value through the manifest, then Puppet will do the right thing during parsing it, but when you introduce Integer or Float from Hiera, then you will get them "as-is" after parsing YAML, meaning as intended types in Ruby, so to speak. And because Ruby is dynamic and uses duck-typing, it simply just work internally to the point when parser is trying to combine both types. > I guess the question boils down to: Is there a way to cast from Fixnum > to String? Yes, look below :) > It seems like an inconsistency to me that in Puppet it works quoted > and unquoted but not in YAML so I'd like to provide the same syntax > for both versions. For now i've added a validate_string($port) call. Puppet in most cases treats non-negative Internet and Float as string (unless this behavior differs nowadays). Take a look on this: https://github.com/kwilczynski/puppet-functions/blob/master/lib/puppet/parser/functions/num2str.rb And this: https://github.com/kwilczynski/puppet-functions/blob/master/lib/puppet/parser/functions/type.rb I hope it helps a little :) KW -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.