Hi,
Until now I work with manifest file. Now I would like to create a perl/php script that will create the YAML script and should overwrite the manifest file.
So I edit the file puppet.conf and put:
mode_terminus = exec
external_nodes = /usr/bin/env PUPPET_DASHBOARD_URL=http://localhost:3000 /path/to/bin/external_node
In the file /path/to/bin/external_node I put my code for the perl script. when I run Puppet on the agent, it's look like it still take the manifest instead of the script I put.
How Can I make this script work instead of the manifest files? how can I debug it?
Also, How can I send parameters to the script? How to access to fact variables from the script, like $hostname etc?
Thanks.
Hi,
Until now I work with manifest file. Now I would like to create a perl/php script that will create the YAML script and should overwrite the manifest file.
So I edit the file puppet.conf and put:
mode_terminus = exec external_nodes = /usr/bin/env PUPPET_DASHBOARD_URL=http://localhost:3000 /path/to/bin/external_node
In the file /path/to/bin/external_node I put my code for the perl script. when I run Puppet on the agent, it's look like it still take the manifest instead of the script I put.
How Can I make this script work instead of the manifest files? how can I debug it?
Also, How can I send parameters to the script? How to access to fact variables from the script, like $hostname etc?
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/6eb837b7-b3d8-4531-ad1b-4f14c2826c60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#!/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,
});
---
classes:
- class1
- class2::basic
- class3
parameters:
puppetserver: puppetsrv
var: kk1
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/85498348-93a0-49ff-bdc5-589f76e7ee79%40googlegroups.com.
--
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.
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.
-- Johan De Wit Open Source Consultant Red Hat Certified Engineer (805008667232363) Puppet Certified Professional 2013/2014 (PCP0000006) _________________________________________________________ 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 _________________________________________________________
Upcoming 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
Is there any way to debug it?
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
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.
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/envPUPPET_DASHBOARD_URL=http://user:pass@localhost:3000/usr/share/puppet-dashboard/bin/external_node
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/4c5248b8-35c3-4013-8556-1fd7626682f0%40googlegroups.com.
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?
On 18 Jun 2014 14:10, <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
> 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
node_terminus = exec.And it work when 'external_nodes =' with or without the ' /usr/bin/env PUPPET_DASHBOARD_URL=http://user:pass@localhost:3000'
Config file /etc/puppet/puppet.conf changed; triggering re-parse of all config files.
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'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?