So, based on the error messages, it's obvious that the generate() function is returning the string data type. Can I force it to return the hash data type?Or is there a way to convert a string to a hash?
Allen,
The generate function simply returns the output of an external command, as executed on the puppet master.
Since bash only started supporting associative arrays (hashes/dictionaries) in version 4 it is highly likely that your bash script is outputting a string and not a hash. The format for an associative array in bash also doesn't resemble the same syntax that you find in puppet (ruby).
I'm not sure as to how ruby or puppet for that matter would interpret bash's representation of an array or hash. Bash has limited ability to define data structures. This in turn would limit how an interpreter such as ruby or puppet could effectively use its data types.
With this being said, try possibly using ruby or python for your external program language. This way the data structure will be in s more usable format. If that's not possible, research associative arrays in bash and see if you can make them work with puppet.
Mike
Sent with AquaMail for Android
http://www.aqua-mail.com
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/91e35347-0765-491c-95de-ea31f0eaceb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.