Thanks for the response, I see that I made an typo..

The parameter nodes_data needs to be node_data as I have corrected below. But the error stands.

-------------- testnode.pp --------------

node testnode {
   class { 'testclass':
       node_data =>  {
'node1' => { 'server' => 'node1.some.domain.com', 'port' => '2560' }, 'node2' => { 'server' => 'node2.another.domain.com', 'port' => '2564' }, 'node3' => { 'server' => 'node3.some.domain.com', 'port' => '2564' }
       }
   }
}

--------------  testclass.pp --------------
class testclass ( $node_data ) {
   node_data += {
'node4' => { 'server' => 'node4.another.domain.com', 'port' => '2564' }, 'node5' => { 'server' => 'node5.some.domain.com', 'port' => '2564' }
   }

   class { 'moduletest::test':
       module_variable =>  $node_data
   }
}

------------------------------------------


When delete the rows:

   node_data += {
'node4' => { 'server' => 'node4.another.domain.com', 'port' => '2564' }, 'node5' => { 'server' => 'node5.some.domain.com', 'port' => '2564' }
   }

everything works fine. But then I still have the problem how to make the settings that needs to be global and node specific at one hash?

Kinds regards,

Michiel Piscaer

On 23-02-12 21:04, Walter Heck wrote:
Where you call the class you mention nodes_data, and inside the class
it's node_data. Unless this is not a one-to-one copy-paste that might
be your problem?



On Wed, Feb 22, 2012 at 15:21, M. Piscaer<deb...@masterpe.nl>  wrote:
Hi,

I have an problem that I can't get resolved. I have an hash like
www.krzywanski.net/archives/703.

With this hash i whould like the add some extra hashes before passing to the
module, i have tryed the code below.


node testnode {
    class { 'testclass':
        nodes_data =>  {
            'node1' =>  { 'server' =>  'node1.some.domain.com', 'port' =>
'2560' },
            'node2' =>  { 'server' =>  'node2.another.domain.com', 'port' =>
'2564' },
            'node3' =>  { 'server' =>  'node3.some.domain.com', 'port' =>
'2564' }
        }
    }
}

class testclass ( $node_data ) {
    node_data += {
        'node4' =>  { 'server' =>  'node4.another.domain.com', 'port' =>  '2564'
},
        'node5' =>  { 'server' =>  'node5.some.domain.com', 'port' =>  '2564' }
    }

    class { 'moduletest::test':
        module_variable =>  $node_data
    }
}

But then I get the error:

err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Cannot append, variable node_data is defined in this scope at
/opt/puppet/env/manifests/classes/testclass.pp:1 on node
testmp-test-04.intern
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

Without adding the information everything works fine.


Kind regards,

Michiel Piscaer

--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.




--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to