On Tuesday, July 22, 2014 10:20:29 AM UTC-5, Matthew Burgess wrote: > > Hi, > > It's probably best for you to not ask why we're doing the following, >
Cause if you told us, you'd have to kill us? > but here's what we're trying to achieve: > > We'd like to programmatically edit our Hiera data, and we're using the > YAML backend. I can successfully load the correct YAML file and make > the changes we require. However, we've hit upon a bit of a stumbling > block if the YAML file contains an interpolation token, if gets > 'corrupted' by the default Ruby YAML emitter like so: > > ipaddress: "%{::ipaddress_eth0}" > > becomes > > ipaddress: ! '%{::ipaddress_eth0}' > > When I inspect the data following the load of the YAML file, I can see > it's been loaded correctly, so it seems to be when I call YAML.dump() > that it gets 'corrupted'. > The '!' is the (correct) "non-specific tag" for the value, chosen by default when the YAML parser loads the untagged data. I am uncertain why the emitter is outputting it, but I don't think it changes the meaning. Can you successfully load the output back into Ruby? If so, then would it be acceptable to just accept the current result? John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c87089f9-9b7d-4c68-ba4c-f5fb8d33dfd1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.