I have written a custom function that returns a hash of data to be used by the create_resources function.
class network::multiroute::mhpeers (
) {
$routes = gen_ip_routes("gw.uk")
create_resources(network::multiroute::mhpeer, $routes)
}
However, on the puppet client I get "err: Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert Array into Hash"
My custom function returns the following data structure:
{"10.100.0.9"=>{"dstip"=>"10.100.0.10", "dsthost"=>"gw1.uk"}, "10.100.0.46"=>{"dstip"=>"10.100.0.45", "dsthost"=>"gw1.fr"}, "10.100.0.17"=>{"dstip"=>"10.100.0.18", "dsthost"=>"gw2.us"}, "10.100.0.13"=>{"dstip"=>"10.100.0.14", "dsthost"=>"gw1.us"}}
Based on the puppet source the rdoc states:
The hash should be in the form `{title => {parameters} }`
I believe I am returning the hash in the correct format so I am confused as to what the problem could be. I've been stuck on this issue for quite some time, any pointers would be really appreciated!
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/h4EyleCsPLsJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Wed, Sep 5, 2012 at 7:05 AM, JeremyCampbell <jeremyca...@gmail.com> wrote:I have written a custom function that returns a hash of data to be used by the create_resources function.
class network::multiroute::mhpeers (
) {
$routes = gen_ip_routes("gw.uk")
create_resources(network::multiroute::mhpeer, $routes)
}
However, on the puppet client I get "err: Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert Array into Hash"can you try this with --trace and post the output?
also,can you put the following line before the call to create_resources just to verify the data structure?$foo = inline_template("<% puts routes.inspect %>")
also, could you try quoting the name of the defined type? 'network::multiroute::mhpeer'
also,can you put the following line before the call to create_resources just to verify the data structure?$foo = inline_template("<% puts routes.inspect %>")
I've done that but I'm not sure where/what output you expect. Please advise.
also, could you try quoting the name of the defined type? 'network::multiroute::mhpeer'
Ok, Ive done this, but it doesn't make any difference.
My custom function returns the following data structure:
{"10.100.0.9"=>{"dstip"=>"10.100.0.10", "dsthost"=>"gw1.uk"}, "10.100.0.46"=>{"dstip"=>"10.100.0.45", "dsthost"=>"gw1.fr"}, "10.100.0.17"=>{"dstip"=>"10.100.0.18", "dsthost"=>"gw2.us"}, "10.100.0.13"=>{"dstip"=>"10.100.0.14", "dsthost"=>"gw1.us"}}
Based on the puppet source the rdoc states:
The hash should be in the form `{title => {parameters} }`
I believe I am returning the hash in the correct format so I am confused as to what the problem could be. I've been stuck on this issue for quite some time, any pointers would be really appreciated!
To post to this group, send email to puppet...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/h4EyleCsPLsJ.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/V4MvJx5TfXAJ.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/QLYzDRNyhxEJ.