Ask Your Question
0

custom function value in params.pp

asked 2016-03-27 10:56:26 -0500

Ath gravatar image

Hi,

I have a module in which I want to access the custom function from the params.pp.

I tried adding it in params.pp like this

$myvar = minute_from_address()

But it doesn't work.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'myvar' at /etc/puppetlabs/code/environments/production/modules/testmodule/manifests/params.pp:3:9

However adding to the init.pp will work

Is it possible access custom function returns from params.pp ?

Regards,

A

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-03-27 11:19:54 -0500

Yes, sure it is. You're looking in the wrong place; you simply have a syntax error in that file, and it's nothing to do with your custom function. Sometimes the line mentioned isn't the line that has the syntax error. Try selectively commenting out blocks to isolate the location of the syntax error. Use puppet parser validate on the file to see if the syntax error's still there.

edit flag offensive delete link more

Comments

Thanks for the reply. But with the same code it did work when I put it in the init.pp. I will check the code anyway.

Ath gravatar imageAth ( 2016-03-27 12:43:52 -0500 )edit

I am so sorry. I was doing it all wrong in params.pp. It works now!

Ath gravatar imageAth ( 2016-03-27 12:51:52 -0500 )edit

Glad to hear.

Alex Harvey gravatar imageAlex Harvey ( 2016-03-27 21:56:17 -0500 )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

Stats

Asked: 2016-03-27 10:56:26 -0500

Seen: 114 times

Last updated: Mar 27 '16