On Tuesday, November 24, 2015 at 2:03:04 PM UTC-6, Matthew Ceroni wrote:
>
> Working on migrating my manifests to work with Puppet 4.0. Currently on 
> 3.8 and have started to experiment with the future parser (probably not so 
> much future anymore).
>
> I am stuck on an error that is being reported.
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Evaluation Error: Error while evaluating a Function Call, ensure parameter 
> must be specified at 
> /etc/puppet/environments/sandbox/modules/sudo/manifests/init.pp:51:2 on 
> node op1227
>
> The code is a simple check and fail if not met
>
>     if ! ($ensure in [ 'present', 'absent' ]) {
>         fail("sudo 'ensure' parameter must be set to either 'absent' or 
> 'present'")
>     }
>
> It isn't liking something about the function call fail. 
>
>
In a sense, the whole point of fail() is for Puppet to not like it: its 
purpose is to abort catalog building.  I think you are mistaken, however; 
the error message text is not consistent with the manifest code you 
presented, so I don't think that specific code is directly related to your 
problem.  You may be looking at the wrong line or at the wrong file (maybe 
the wrong version of the file).  Perhaps you are looking at a manifest for 
the wrong environment.

The result you described would be the natural effect of the fail() function 
if the message reported in the log matched the function argument.  The 
message that is emitted is similar enough to the argument in the code you 
presented, and the condition under which the function is called is enough 
reminiscent of it, that I'm leaning toward the theory that you're looking 
at the wrong version of the manifest, with the root problem being that an 
unsupported (or no) value has been given for $ensure.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5faae111-0e39-474e-a069-fc56097894a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to