Ask Your Question
0

Passing params from one defined type to another defined type

asked 2014-11-14 20:32:48 -0600

Pindish gravatar image

I have a need to define my hiera data with multiple levels of hashes. For example:

My yaml file:

mymod::mydata:
  'data1':
    time: '10:30AM'
    wday: 'Thu'
    users:
      'user1':
        action: 'add'
        name: 'john'
        age: '47'
      'user2':
        action: 'delete'
        name: 'tom'
        age: '21'

In my base class I call the first defined type:

$data = hiera_hash('mymod::mydata', undef)
if $data {
  create_resource(mymod::manage_mydata, $data)
}

I can see the actual data I get in mymod::manage_mydata with:

notify { "users = $users": }

But when I call another defined type with create_resource(), "$users" has null value in mymod::manage_users:

create_resource(mymod::manage_users, $users)

How do I pass the value of $users to "mymod::manage_users"?

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-11-15 19:25:34 -0600

Pindish gravatar image

Passing variable this way actually works. I have a different problem, will post a new question.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-11-14 20:32:48 -0600

Seen: 279 times

Last updated: Nov 15 '14