Ask Your Question

How to access the the parameters within same type?

asked 2017-03-04 23:15:20 -0600

Hyder gravatar image

updated 2017-03-08 09:37:31 -0600

for example

         newparam(:foo) do
             newvalues(:abc, :xyz)
         newparam(:bar) do
             if foo == :xyz
                bar = 123
                bar = 789         #This whole block gives me eroor. How can I access the above parameter in custom type?
edit retag flag offensive close merge delete


The above is my custom type. please help me!

Hyder gravatar imageHyder ( 2017-03-04 23:16:48 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-06 05:53:11 -0600

puser gravatar image

updated 2017-03-08 09:04:58 -0600

I am a little confused why you want two parameters that are named differently with the same name. In your provider just use the same param in different spots? A little enlightenment might help us solve this.



    priority: '00'
    priority: '99'


class myclass (
  #declare your custom type and pass $vhosts to it
edit flag offensive delete link more


Based upon previous parameter value I wanted to assign values for next parameter

Hyder gravatar imageHyder ( 2017-03-06 09:04:55 -0600 )edit

it sounds like it would be better to create hash set in hiera and pass the hash to your custom type, that way the relationships are known based on the hash keys and values.

puser gravatar imagepuser ( 2017-03-07 06:17:16 -0600 )edit

can you please tell me how to create hash set in hiera and pass the hash to my custom type?

Hyder gravatar imageHyder ( 2017-03-08 07:36:40 -0600 )edit

Thanks Eric I have edited the question can you please now check and help me.

Hyder gravatar imageHyder ( 2017-03-08 09:36:37 -0600 )edit

The above is wrong. You are not processing any data in the custom type! you are defining the inputs for the provider to interpret. For example the type can say if param(:bar) is a number, then proceed, else error out.

puser gravatar imagepuser ( 2017-03-08 13:40:11 -0600 )edit

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


Asked: 2017-03-04 23:15:20 -0600

Seen: 73 times

Last updated: Mar 08 '17