| Since you're already using YAML, maybe it would make sense to make use of the existing syntax for YAML anchors? Instead of making the Hiera-specific syntax more convoluted by adding an optional argument for type coercion, as suggested in comment #1, this would keep the syntax (relatively) simple. According to the YAML 1.2 spec there shouldn't be any problem with anchors containing any of the valid characters for Puppet identifiers, i.e. an anchor like *::some::weird_identifier::here is perfectly fine. With that it would be possible to use any types in facts without having to explicitly state the type. I imagine it's possible to hook into the YAML deserialization to make this possible. Of course, this means that Puppet YAML breaks the YAML spec by abusing anchors, but I imagine that not many people use YAML anchors, and even less people use YAML anchors with :: in them, making this less of an issue. |