On Tuesday, June 17, 2014 8:19:59 AM UTC-5, shlo....@gmail.com wrote:
>
>
> I read the documentation.
> I send yesterday example of my perl ENC code  and the output.  I'm sending 
> them again:
>
>     #!/usr/bin/perl -w
>>     use strict;
>>     use YAML qw(Dump);
>>     
>>     my $hostname = shift || die "No hostname passed";
>>     
>>     system("echo $hostname >> /tmp/llkkll");
>>     
>>     my ($host, $domain, $net) = ($1, $2, $3);
>>     
>>     my @classes = ();
>>     my %parameters = (
>>         puppetserver => "puppetsrv"
>>     );
>>         @classes = ('class1', 'class2::basic', "class3");
>>         $parameters{var} = "kk1";
>>     
>>     
>>     print Dump({
>>         classes => \@classes,
>>         parameters => \%parameters,
>>     }); 
>
>
> that as output give me:
>
> ---
>> classes:
>>   - class1
>>   - class2::basic
>>   - class3
>> parameters:
>>   puppetserver: puppetsrv
>>   var: kk1
>
>  
>
> The definition of the classes are in manifests under the module directory.
>
> My problem: 
> when I run the puppet command on the agent, it look like it *ignore* the 
> classes I define in ENC script
> and only if I have the node definition in node.pp it try to so something.
>
> Maybe I'm missing very basic issue. I'm sorry.
>


Probably.  Hooking up an ENC is not very hard.

If the ENC is not running when a catalog request comes in then most likely 
the ENC it is not properly configured.  Supposing that you are running in 
agent / master mode, the ENC needs to be set up on the master.  There, the 
'node_terminus' configuration parameter must be set to "exec" and the 
'external_nodes' configuration parameter must be set to the absolute 
pathname of the ENC script.

Furthermore, the script must be accessible and executable by the master, 
which typically does not run as a privileged user.  Not only the script, 
but also all directories in the path to it must be readable and 
executable/traversable by the master.  File permissions and other access 
controls may come into play here.

Also, once it is properly configured, you need to restart the master in 
order for the new configuration to be noticed.

It is highly unlikely that the master is running the ENC successfully, the 
output is what you say, and yet it is ignored.

 

> Is there any way to debug it? 
>
>

I would start by looking at the master's log.  If you're not already 
running the master with --debug output turned on, then I would do that, 
too, to make the log more informative.  Likewise, look at the agent's log.  
In particular, make sure the agent successfully retrieved a fresh catalog 
from the master -- it will complain if it cannot do so, but it may then 
proceed to use a cached catalog.


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/760300a8-e0c5-4043-8fb2-bfcd1871af11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to