Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-19 Thread shlo . afgin


*It's work. *
It was spelling problem, I change it now to: 

*node_terminus = exec. *

And it work when 'external_nodes =' with or without the ' /usr/bin/env 
PUPPET_DASHBOARD_URL=http://user:pass@localhost:3000' 
I also delete *'node: certname*' from my script. 

Now when I start httpd, after changing the puppet.conf, I get in the system 
message file: 

*Config file /etc/puppet/puppet.conf changed; triggering re-parse of all 
config files. *


But I start getting in the puppet server, system message file: 


*puppet-agent[23124]: Failed to apply catalog: getaddrinfo: Name or service 
not known puppet-agent[23124]: Could not send report: getaddrinfo: Name or 
service not known *


Sorry  I'm very appreciate your help, Thanks to everyone! 

Q: If I upgrade puppet, should I backup something. Can it make my puppet 
server/Passenger stop working? 

-- 
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/330d6a5a-11a1-4754-90ac-b01436f6f9a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-19 Thread jcbollinger


On Thursday, June 19, 2014 2:48:19 AM UTC-5, shlo@gmail.com wrote:



 *It's work. *
 It was spelling problem, I change it now to: 

 *node_terminus = exec. *



Good.

 

 And it work when 'external_nodes =' with or without the ' /usr/bin/env 
 PUPPET_DASHBOARD_URL=http://user:pass@localhost:3000' 



Surprising.  You should anyway omit that bit.

 

 I also delete *'node: certname*' from my script. 



Fine. I'm not sure what that's supposed to be for, either.  I don't think 
it's required.

 

 Now when I start httpd, after changing the puppet.conf, I get in the 
 system message file: 

 *Config file /etc/puppet/puppet.conf changed; triggering re-parse of all 
 config files. *




Ok.

 

 But I start getting in the puppet server, system message file: 


 *puppet-agent[23124]: Failed to apply catalog: getaddrinfo: Name or 
 service not known puppet-agent[23124]: Could not send report: getaddrinfo: 
 Name or service not known *




It looks like the agent is trying to contact the master via a machine name 
that it cannot resolve.  Since this is happening on the machine that hosts 
the master, and you've been mucking with the Puppet configuration on that 
machine, it seems likely that you changed something there to create this 
problem (or maybe Puppet itself did, at your behest).

In particular, unless your machine can resolve the hostname puppet (to 
the address of the master), the [agent] section of your puppet.conf should 
contain a 'server' setting that identifies the puppetmaster machine by a 
resolvable name that appears on the master's certificate.  Normally, the 
master's FQDN is a good choice.

 

 Sorry  I'm very appreciate your help, Thanks to everyone! 

 Q: If I upgrade puppet, should I backup something. Can it make my puppet 
 server/Passenger stop working? 



It's always wise to make backups before updating critical components.  Any 
update you perform carries some risk of breakage.

With that said, Puppet bugfix updates (x.y.n to x.y.m) are pretty safe.  
You should not expect any breakage around such updates unless you happen to 
be relying on buggy behavior (which is never safe).  Puppet feature updates 
(x.n.y to x.m.z) are generally safe.  They are not supposed to cause 
breakage of any documented behavior, but regressions occasionally happen.

You should already have your manifests (including third-party modules) and 
data under revision control, in which case you don't need any additional 
backup of those.  For the most protection, you should also back up your 
master's data directory, especially all the SSL certificates.  Losing those 
may require you to generate new certificates for all your clients, which 
can really ruin your day.


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/c7d0bea8-0c26-442e-b69b-f110fa0b730f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-18 Thread shlo . afgin

*Thanks for the details response.*

On Tuesday, June 17, 2014 10:28:01 PM UTC+3, jcbollinger wrote:

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.

  
All done already as you describe.
 

 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.


I will try that.


 John


Thanks a lot! 

-- 
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/491960a1-8081-4835-a18f-c546bc88e988%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-18 Thread shlo . afgin



Hi,

I still can make the ENC work on my puppet server.

General:
Puppet server: 3.3.1 Puppet agent: 2.7.25
The server run Passenger on Apache, so the puppetmaster run from apache and 
not by himself.

I have in /etc/puppet/puppet.conf :
[master]
mode_terminus = exec
external_nodes = /usr/bin/env 
PUPPET_DASHBOARD_URL=http://user:pass@localhost:3000 
/usr/share/puppet-dashboard/bin/external_node

script details:
The file external_node  contain perl, all  the directories and 
the external_node itself have the permission 755.

I did:
*  When I run the perl script locally  (as a regular script from the 
command line – not with puppet) on the puppet server it run okay and give 
the YAML output I sent in my previous emails.
*  looking for errors in messages log and apache log – nothing 
look suspicious. But the warning:
 -   [warn] RSA server certificate is a CA certificate 
(BasicConstraints: CA == TRUE !?)
  -  YAML in network requests is deprecated and will be removed in a 
future version. 
*  Also tried to make syntax error in  my perl script external_node – got 
no error in the logs.

What make me think maybe:
* puppet it not running external_node script at all.
* ENC have problems when it Passenger  Apache?

Thanks for all the people who answer me.

-- 
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/4c5248b8-35c3-4013-8556-1fd7626682f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-18 Thread RichTea
On 18 June 2014 14:10, shlo.af...@gmail.com wrote:


 Hi,

 I still can make the ENC work on my puppet server.

 General:
 Puppet server: 3.3.1 Puppet agent: 2.7.25
 The server run Passenger on Apache, so the puppetmaster run from apache
 and not by himself.

 I have in /etc/puppet/puppet.conf :
 [master]
 mode_terminus = exec

 ​​
 external_nodes =
 ​​
 /usr/bin/env
 ​​
 PUPPET_DASHBOARD_URL=http://user:pass@localhost:3000
 ​​
 /usr/share/puppet-dashboard/bin/external_node


​Once again why do you have all that in your external_nodes​

?
  eg what is ​/usr/bin/env doing, what is ​PUPPET_DASHBOARD_URL=http://

user:pass@localhost:3000 doing for you?

Why not just ​external_nodes = ​/usr/share/puppet-dashboard/

bin/external_node


Is your external_nodes script executable by puppet?


Did you add the node: certname bit to your YAML output as suggested?


--

Ritchie

  script details:
 The file external_node  contain perl, all  the directories and
 the external_node itself have the permission 755.

 I did:
 *  When I run the perl script locally  (as a regular script from the
 command line – not with puppet) on the puppet server it run okay and give
 the YAML output I sent in my previous emails.
 *  looking for errors in messages log and apache log – nothing
 look suspicious. But the warning:
  -   [warn] RSA server certificate is a CA certificate
 (BasicConstraints: CA == TRUE !?)
   -  YAML in network requests is deprecated and will be removed in a
 future version.
 *  Also tried to make syntax error in  my perl script external_node – got
 no error in the logs.

 What make me think maybe:
 * puppet it not running external_node script at all.
 * ENC have problems when it Passenger  Apache?

 Thanks for all the people who answer me.

  --
 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/4c5248b8-35c3-4013-8556-1fd7626682f0%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/4c5248b8-35c3-4013-8556-1fd7626682f0%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAFWLKddv75ovMwp4wLm-%2Biyog2puEYM0BtEwWW82_Om3ap1VsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-18 Thread shlo . afgin

I tried also just /usr/share/puppet-dashboard/bin/external_node it act the 
same way.
I add node:, I hope I did it in the right way because I did not find it in 
the document - also not work.
If I'm not adding any 'node: ', It should work for all the nodes the same. 
Am I right? or it must appear in the output?

Also I have another warning that I did not mention in my previous email, 
which I consider as warning:
 Gem::Specification#installation_path called from 
/usr/share/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:93.
 NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It 
will be removed on or after 2011-10-01.
I tried to solve this warning in the past - with no success.

Thank you.


On Wednesday, June 18, 2014 5:10:43 PM UTC+3, RichT wrote:




 On 18 June 2014 14:10, shlo@gmail.com javascript: wrote:


 Hi,

 I still can make the ENC work on my puppet server.

 General:
 Puppet server: 3.3.1 Puppet agent: 2.7.25
 The server run Passenger on Apache, so the puppetmaster run from apache 
 and not by himself.

 I have in /etc/puppet/puppet.conf :
 [master]
 mode_terminus = exec
 
 ​​
 external_nodes = 
 ​​
 /usr/bin/env 
 ​​
 PUPPET_DASHBOARD_URL=http://user:pass@localhost:3000 
 ​​
 /usr/share/puppet-dashboard/bin/external_node


 ​Once again why do you have all that in your external_nodes​
  
 ?
   eg what is ​/usr/bin/env doing, what is ​PUPPET_DASHBOARD_URL=http://

 user:pass@localhost:3000 doing for you? 

 Why not just ​external_nodes = ​/usr/share/puppet-dashboard/

 bin/external_node


 Is your external_nodes script executable by puppet?


 Did you add the node: certname bit to your YAML output as suggested?


 --

 Ritchie

  script details:
 The file external_node  contain perl, all  the directories and 
 the external_node itself have the permission 755.

 I did:
 *  When I run the perl script locally  (as a regular script from the 
 command line – not with puppet) on the puppet server it run okay and give 
 the YAML output I sent in my previous emails.
 *  looking for errors in messages log and apache log – nothing 
 look suspicious. But the warning:
  -   [warn] RSA server certificate is a CA certificate 
 (BasicConstraints: CA == TRUE !?)
   -  YAML in network requests is deprecated and will be removed in a 
 future version. 
 *  Also tried to make syntax error in  my perl script external_node – got 
 no error in the logs.

 What make me think maybe:
 * puppet it not running external_node script at all.
 * ENC have problems when it Passenger  Apache?

 Thanks for all the people who answer me.

  -- 
 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...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/4c5248b8-35c3-4013-8556-1fd7626682f0%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/4c5248b8-35c3-4013-8556-1fd7626682f0%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.




-- 
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/52cb308a-6843-41a3-b700-cdaa3efc82a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-18 Thread jcbollinger


On Wednesday, June 18, 2014 8:10:38 AM UTC-5, shlo@gmail.com wrote:


 Hi,

 I still can make the ENC work on my puppet server.

 General:
 Puppet server: 3.3.1 Puppet agent: 2.7.25


That's a potential problem, but not likely the one you're currently 
fighting.  The master provides as much compatibility with older agents as 
it can, but that's so much older an agent (in version number terms) that 
you're pushing the envelope.  Moreover, even the master is a little old -- 
current is 3.6.2.

 

 The server run Passenger on Apache, so the puppetmaster run from apache 
 and not by himself.

 I have in /etc/puppet/puppet.conf :
 [master]
 mode_terminus = exec
 external_nodes = /usr/bin/env 
 PUPPET_DASHBOARD_URL=http://user:pass@localhost:3000 
 /usr/share/puppet-dashboard/bin/external_node


Per the docs, the 'external_nodes' property should be the full path to the 
ENC executable.  Note well: path to the executable not command line. 
Puppet will run that executable -- probably directly, not via a shell -- 
passing it the node's certname as the only argument.

 

 script details:
 The file external_node  contain perl, all  the directories and 
 the external_node itself have the permission 755.

 I did:
 *  When I run the perl script locally  (as a regular script from the 
 command line – not with puppet) on the puppet server it run okay and give 
 the YAML output I sent in my previous emails.
 *  looking for errors in messages log and apache log – nothing 
 look suspicious. But the warning:
  -   [warn] RSA server certificate is a CA certificate 
 (BasicConstraints: CA == TRUE !?)
   -  YAML in network requests is deprecated and will be removed in a 
 future version. 
 *  Also tried to make syntax error in  my perl script external_node – got 
 no error in the logs.

 What make me think maybe:
 * puppet it not running external_node script at all.


That seems a reasonable conclusion.

 

 * ENC have problems when it Passenger  Apache?


No.  But perhaps either

   1. Puppet is not using the config file you think it's using, or
   2. you have not properly restarted the master to get it to read its 
   updated configuration.
   
Under Passenger, the config file Puppet uses is affected by your 
config.ru.  In particular, therein you need to be sure to set the 
appropriate --confdir and --vardir.  The default config.ru shipped with 
Puppet should be correct for a default Puppet installation, but if you 
installed in a different location or rolled your own config.ru then perhaps 
the problem is there.  It's worth having a look in any case.


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/4179a29e-5478-4196-a561-c9096ac90b1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-18 Thread Matthew Burgess
On 18 Jun 2014 14:10, shlo.af...@gmail.com wrote:


 Hi,

 I still can make the ENC work on my puppet server.

 General:
 Puppet server: 3.3.1 Puppet agent: 2.7.25
 The server run Passenger on Apache, so the puppetmaster run from apache
and not by himself.

 I have in /etc/puppet/puppet.conf :
 [master]
 mode_terminus = exec

??? That should be node_terminus not mode_terminus.

Matt

-- 
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/CAKUTv3%2BZm%2BZ1ZCdUMEpeoUyGRbOgxXbf4sZwJhUjSpN9%3DOH-7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-17 Thread Jason Antman

Yes, I have an idea.

1) Read the documentation: 
http://docs.puppetlabs.com/guides/external_nodes.html
2) If that doesn't help, post your ENC code, with specific examples of 
output and problems that you're having.


On 06/17/2014 07:49 AM, shlo.af...@gmail.com wrote:


Hi,

I understood  ENC can work without the PuppetDB installation.
I cannot make ENC work and I cannot find a log or any way to debug it, 
so I can find the problem.


any idea are welcome.
Thanks.
--
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 
mailto:puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/85498348-93a0-49ff-bdc5-589f76e7ee79%40googlegroups.com 
https://groups.google.com/d/msgid/puppet-users/85498348-93a0-49ff-bdc5-589f76e7ee79%40googlegroups.com?utm_medium=emailutm_source=footer.

For more options, visit https://groups.google.com/d/optout.


--
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/53A02D79.50005%40jasonantman.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-17 Thread shlo . afgin

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.
Is there any way to debug it? 

On Tuesday, June 17, 2014 2:58:55 PM UTC+3, Jason Antman wrote:

  Yes, I have an idea.

 1) Read the documentation: 
 http://docs.puppetlabs.com/guides/external_nodes.html
 2) If that doesn't help, post your ENC code, with specific examples of 
 output and problems that you're having.

  

-- 
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/5a15194a-c44e-4c3b-b62b-cc07e8094bf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-17 Thread Johan De Wit

I think, in your yaml, you are missing the name: certname

Grts

jo

On 17/06/14 15:19, shlo.af...@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.
Is there any way to debug it?

On Tuesday, June 17, 2014 2:58:55 PM UTC+3, Jason Antman wrote:

Yes, I have an idea.

1) Read the documentation:
http://docs.puppetlabs.com/guides/external_nodes.html
http://docs.puppetlabs.com/guides/external_nodes.html
2) If that doesn't help, post your ENC code, with specific
examples of output and problems that you're having.

--
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 
mailto:puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5a15194a-c44e-4c3b-b62b-cc07e8094bf4%40googlegroups.com 
https://groups.google.com/d/msgid/puppet-users/5a15194a-c44e-4c3b-b62b-cc07e8094bf4%40googlegroups.com?utm_medium=emailutm_source=footer.

For more options, visit https://groups.google.com/d/optout.



--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer  (805008667232363)
Puppet Certified Professional 2013/2014 (PCP006)
_
 
Open-Future Phone +32 (0)2/255 70 70

Zavelstraat 72  Fax   +32 (0)2/255 70 71
3071 KORTENBERG Mobile+32 (0)474/42 40 73
BELGIUM http://www.open-future.be
_
 



Next Events:
Puppet Advanced Training | 
https://www.open-future.be/puppet-advanced-training-10-till-12th-june
Puppet Introduction Course | 
https://www.open-future.be/puppet-introduction-course-13th-june
Linux Training | https://www.open-future.be/linux-training-16-till-20th-june
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
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/53A04BA6.8070005%40open-future.be.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-17 Thread jcbollinger


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.


Re: [Puppet Users] Re: Moving from manifest files to ENC script - not working...

2014-06-16 Thread Ken Barber
 When I install open source Puppet 3.3.1, I follow old instruction of 2.6.0.
 I did not install the PuppetDB, unless it came by default installation. Is
 it installed with open source puppet 3.3.1?

No it is not. It's a separate step. Follow the documentation:
http://docs.puppetlabs.com/puppetdb/latest/

ken.

-- 
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/CAE4bNTnNjVZ91aWZcYW2W3RLsJ6UpiVKdKnfaDrDyx0EgNaePQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.