Issue #13212 has been updated by Anita Krueger.

We are having the same issue passing an array out of hiera. The results are 
intermittent without any code changes between test runs.

Following are our environment details:

`puppet master > Redhat 6.2 2.6.32-220.el6.x86_64, puppet 2.7.13, ruby 1.8.7 
(2011-06-30 patchlevel 352) [x86_64-linux]`

`puppet client > Redhat 6.2 2.6.32-220.el6.x86_64, puppet 2.7.13, ruby 1.8.7 
(2011-06-30 patchlevel 352) [x86_64-linux]`

This is our init.pp for a module named users, it just calls a define so it can 
loop through the array that is passed:

`class users ( $users ) {
  users::create_users { $users: }
}`

The define is declared in create_users.pp (right now it only notifies):

`define users::create_users {
  notify{"user is ${name[name]} with uid ${name[uid]}": }
}`

The hiera structure looks like this:

    users_users:
      -
        name: 'testuser1'
        uid:  '901'
      -
        name: 'testuser2'
        uid:  '902'

Calling the module like this (using hiera_array to look up):

`node 'client1' {
  class { 'users': users => hiera_array('users_users') }
}`

A successful output looks like this:

`info: Caching catalog for client1.example.com
info: Applying configuration version '1334307453'
notice: user is testuser2 with uid 902
notice: /Stage[main]/Users/Users::Create_users[uid902nametestuser2]/Notify[user 
is testuser2 with uid 902]/message: defined 'message' as 'user is testuser2 
with uid 902'
notice: user is testuser1 with uid 901
notice: /Stage[main]/Users/Users::Create_users[uid901nametestuser1]/Notify[user 
is testuser1 with uid 901]/message: defined 'message' as 'user is testuser1 
with uid 901'
notice: Finished catalog run in 0.15 seconds`

A failed output looks like this:

`err: Could not retrieve catalog from remote server: Could not intern from 
pson: Could not convert from pson: Could not find relationship target 
"Users::Create_users[uid902nametestuser2]"
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run`

As I said, between test runs there are no code changes. Any ideas anyone?

Thanks a lot, Anita
----------------------------------------
Bug #13212: Pass array to custom define fails
https://projects.puppetlabs.com/issues/13212#change-60536

Author: Juan José Presa Rodal
Status: Needs More Information
Priority: Normal
Assignee: 
Category: parser
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


I'm trying to pass a simple array to a custom define and fails with error:

`err: Could not retrieve catalog from remote server: Could not intern from 
pson: Could not convert from pson: Could not find relationship source 
"Foo::Map[idbazip2.2.2.2]"
`

I think that code is very correct:


`$foo = [{"id" => "bar", "ip" => "1.1.1.1"}, {"id" => "baz", "ip" => 
"2.2.2.2"}]`

`foo::map {$foo:}`

`define foo::map () {
  notify {$name['id']:
  }
}
`


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to