Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

Puppet 2.7 issue: Facter value not reflecting in puppet manifest

define hostclass with special characters
(24 lines)
puppet, virtualenv, and .bashrc
(62 lines)
Feb 8, 2012
Ashish Gupta
Ashish Gupta
Hi,

Facter value is not reflecting in puppet manifest.

Along with books ProPuppet and "Puppet 2.7 Cookbook", I am referring to
following links:
http://docs.puppetlabs.com/guides/custom_facts.html
http://projects.puppetlabs.com/projects/1/wiki/Adding_Facts
http://docs.puppetlabs.com/guides/plugins_in_modules.html
http://www.puppetcookbook.com/posts/s...ed-on-a-fact.html
http://docs.puppetlabs.com/guides/faq...ingsystem-get-set
http://groups.google.com/group/puppet.../c2af30e123c92e91

For my test set-up I have 2 ec2 instances, one puppet master and one puppet
agent. Both instances have Ubuntu 10.04 and have following version of
puppet and facter:
roo### @master:~# puppet --version
2.7.9
ro### @master:~# facter --version
1.6.4

On master /etc/puppet/puppet.conf has
plugindest = /var/lib/puppet/lib
pluginsource = puppet://puppet/plugins
pluginsync = true

I tried hardcoding pluginsource to fqdn of puppet master, but it didn't
work. Also 'puppet master --genconfig | grep plugin' also gaves same
results as puppet.conf.

On master I have my change.erb on
modulepath/module_name/lib/facter/change.rb as well as
on /var/lib/puppet/lib/facter/change.erb. At both places it has execute
permissions.

change.erb looks like:
Facter.add("change") do
  setcode do
    Facter::Util::Resolution.exec(%q<su - ubuntu -c "cd
'/tmp/bloomspot/';
hg parent | head -1 | awk -F: '{print \$NF}'">).chomp
  end
end

My manifests looks like:
  exec { 'copy-code':
    command => "mkdir /tmp/$change",
    user    => 'root',
    path    => "/usr/bin",
    cwd     => '/tmp',
    logoutput => true,
  }

Snippet of client log after running puppet agent:
Feb  7 20:08:14 ip-10-12-59-93 puppet-agent[1766]:
(Exec[copy-code](provider=posix)) Executing 'mkdir /tmp/ '
Feb  7 20:08:14 ip-10-12-59-93 puppet-agent[1766]: Executing 'mkdir /tmp/ '
Feb  7 20:08:14 ip-10-12-59-93 puppet-agent[1766]:
(/Stage[main]/Codebaserel/Exec[copy-code]/returns) executed successfully
Feb  7 20:08:14 ip-10-12-59-93 puppet-agent[1766]:
(/Stage[main]/Codebaserel/Exec[copy-code]) The container Class[Codebaserel]
will propagate my refresh event
Feb  7 20:08:14 ip-10-12-59-93 puppet-agent[1766]: (Class[Codebaserel]) The
container Stage[main] will propagate my refresh event
Also, in puppet logs I don't see anything mentioned about the fact being
pulled/pushed to client.

On client, after setting RUBYLIB and copying changeset.erb in
$RUBYLIB/facter, I confirmed that script can run fine on the client:
ro### @agent:~# facter -p | grep -i change
change => d65575bc8f5f
ro### @agent:~# facter -p change
d65575bc8f5f
ro### @agent:~# facter change
d65575bc8f5f

Manually ruby script is running fine on the agent. Rest of the puppet
modules are running fine. All the required configs seems to have
appropriate value.
What am I missing? Any pointer/suggestions would be helpful.

Thanks for attention.

-Ashish





Reply
Tags: puppetcookbook
Run puppet daily in report mode to detect discrepancies between the reality and the puppet manifest
August 26, 2010 04:39:32 AM
Hello. I'm considering running puppet manually on a few or all of you production servers, instead of automatically via cron or puppetd. I found a presentation from NYSE Euronext and Puppet Labs from this year's Red Hat Summit describing a setup…
PATCH/puppet 1/1] Fix #4348 - Puppet doc single manifest broken
July 25, 2010 08:28:28 AM
The refactoring of using environment instances instead of strings for initializing the parser, rdoc wasn't updated, thus was unable to initialize the parser. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com> --- …
(puppetlabs/puppet) Feature/2.7.x/12066 windows puppet facter build
January 30, 2012 08:15:37 PM
Please review pull request #428:Feature/2.7.x/12066 windows puppet facter build [Link: https://github.com/puppetlabs/puppet/pull/428 ] opened by (jeffmccune) Description: This is Milestone#2 [Link:…
(puppetlabs/puppet) Feature/2.7.x/12066 windows puppet facter build
January 27, 2012 11:31:39 AM
On Fri Jan 27 17:20:49 UTC 2012 pull request #417 was closed. Feature/2.7.x/12066 windows puppet facter build [Link: https://github.com/puppetlabs/puppet/pull/417 ] requested by (jeffmccune) -- You received this message because you are…
(puppetlabs/puppet) Feature/2.7.x/12066 windows puppet facter build
January 31, 2012 12:00:45 PM
On Tue Jan 31 17:51:15 UTC 2012 pull request #428 was closed. Feature/2.7.x/12066 windows puppet facter build [Link: https://github.com/puppetlabs/puppet/pull/428 ] requested by (jeffmccune) -- You received this message because you are…
(puppetlabs/facter) Feature/1.6.x/12066 windows puppet facter build
January 30, 2012 08:00:52 PM
Please review pull request #161:Feature/1.6.x/12066 windows puppet facter build [Link: https://github.com/puppetlabs/facter/pull/161 ] opened by (jeffmccune) Description: Without this patch applied the default behavior of install.rb is…
(puppetlabs/facter) Feature/1.6.x/12066 windows puppet facter build
February 1, 2012 07:16:06 PM
On Thu Feb 02 01:00:36 UTC 2012 pull request #161 was closed. Feature/1.6.x/12066 windows puppet facter build [Link: https://github.com/puppetlabs/facter/pull/161 ] requested by (jeffmccune) -- You received this message because you are…
(puppetlabs/puppet) Simplistic fix for puppet labs Issue #4480
January 28, 2012 01:15:36 PM
Please review pull request #422:Simplistic fix for puppet labs Issue #4480 [Link: https://github.com/puppetlabs/puppet/pull/422 ] opened by (20after4) Description: This will eliminate a significant issue for runit users which causes…
(puppetlabs/puppet) Simplistic fix for puppet labs Issue #4480
February 4, 2012 07:00:46 AM
On Sat Feb 04 12:47:04 UTC 2012 pull request #422 was closed. Simplistic fix for puppet labs Issue #4480 [Link: https://github.com/puppetlabs/puppet/pull/422 ] requested by (20after4) -- You received this message because you are subscribed…
Error in puppet manifest which I cannot track down....
October 26, 2011 03:21:10 PM
Hello all, I'm hoping that someone on this list might be able to help me track down an error in my manifests. I have 3 environments. In my dev environment, I have the following directories configured: /etc/puppet/dev/modules …
puppet manifest execution orders
July 13, 2011 05:41:33 AM
I created manifest for our webserver. manifest included git clone, database creation and restore database etc.... How to order the installation and exec exactly Roni
Allowing puppet to drop privileges for a manifest
January 4, 2011 12:56:39 PM
Greetings, Our environment consists of about 600 Redhat Enterprise Linux 3, 4, 5, and soon 6 servers. We use cfengine 2 currently, but plan on migrating to puppet. Right now, we have our root-owned cfengine client running every 15 minutes from…
is ruby code allowed in puppet manifest?
June 16, 2011 10:58:07 AM
Hi, I'm trying to get the following to work: class cluster { $cluster_name = hostname.slice(0..-2) . . } # class hoping that if I have a server called appfarmserver1 (obtained from facter, can I use a fact like this!?), cluster_name will get…
Accessing puppet.conf settings in a manifest
July 25, 2011 12:56:45 AM
Is there some way I can access variables from puppet.conf (e.g. $confdir) in my manifest?
HowTo/Details about Puppet Manifest Documentation
December 30, 2011 10:24:13 AM
http://projects.puppetlabs.com/projects/1/wiki/Puppet_Manifest_Docume ntation I discovered the self-documentable feature and I am having a fantasic time going through my puppetmaster. The first snag I hit was in trying to make lists of more than…
accessing puppet config variables inside a manifest
January 31, 2011 11:07:06 AM
Hello, I'm currently using a module named "common" which is based off of David Schmitt's work. I'm having issues with it in OpenBSD, and the reason is that the directory created to contain module-specific files is hardcoded to…
PATCH/puppet 2/3] maint: Fix rdoc when documenting manifest files
March 8, 2011 03:32:00 PM
From: Matt Robinson <ma### @puppetlabs.com> The structure of the AST has changed from 2.6.x to master, so the code to generate documentation from the AST had to change. Generating documentation for resources other than classes, nodes and…
Puppet facter operatingsystemrelease
February 8, 2011 04:42:19 PM
Hello, I am running puppet server version 0.25.4-2, and since Debian squeeze is the new stable release I would like to adapt some of my modules. I have a syslog-ng module, I would like to specify another template for my squeeze server. I changed…
Uninstall Puppet and Facter from OSX
November 28, 2011 07:59:48 AM
Hi folks, I'm a new Mac user and a while ago I installed puppet (2.6.7) + facter (1.5.8) from tarballs provided by puppetlabs.com on my Lion machine. Now, I'd like to go for gem install and get puppet 2.7, but I'm not sure if I need to remove…
puppet facter timeout
November 7, 2011 06:35:29 PM
I have a problem with a new Ubuntu server (2.6.32-33-server) and facter. Facter Version 1.5.6 ro### @web002:~# facter /usr/lib/ruby/1.8/timeout.rb:60:in `open': execution expired (Timeout::Error) from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'…
Templating MySQL's my.cnf for setup in Puppet
February 18, 2011
I have been tasked with templating MySQL's my.cnf in an attempt standardize the configuration amongst the slave databases using Puppet. Right now,…
How can I configure exim4 with a smarthost via puppet?
March 26, 2011
I have tried to automate the exim setup via puppet. I followed the approach described here , whiched worked for me for a few packages, but for exim…
Puppet + Passenger + Apache/Nginx
June 22, 2011
I'm working on a very large puppet deployment, but seem to be hitting a brick wall. My ideal setup is to use Nginx + Passenger to serve puppet. The…
Is there any way to use arrays in a puppet module (not in template)?
May 10, 2010
I want to use puppet to manage a hadoop cluster. On the machines we have several directories which must be created and set permissions. But i'm…
Puppet defined resource - selective parameterization?
May 6, 2011
Hi all, I'm currently banging my head trying to find the "best way" to achieve this type of granularity for puppet: I have a server running…
Puppet offloading using NGINX, 403 forbidden error
May 21, 2011
I'm currently trying to offload some of the file serving puppet does using NGINX (As displayed here…
Reflecting changes in database without reloading the page in PHP
May 11, 2011
Hi, I am building a photo sharing service in php. I am using a lightbox in jquery which will popup when we click 'add' button to add photos. We can…
Apache Tomcat Cataline file changes not reflecting!
March 3, 2011
Hi all, I am using apache-tomcat-6.0.18 on windows xp prefossional SP3. My requirement is to show additional information ( like Organization Name)…
HTML5 Manifest Cache behind Basic Auth?
June 9, 2011
I've got a site that's using HTML5 caching and working lovely. When I protect the site using Basic Auth (.htpasswd) the caching doesn't seem to…
HTML5 Cache Manifest works over http but not https
April 13, 2011
My google-fu does not seem up to snuff today so here it goes... I have a django application sitting on top of apache using wsgi. I am attempting to…
Where do I create the file .htaccess, in order to serve my HTML5 cache manifest file correctly?
June 13, 2011
In the post of http://diveintohtml5.org/offline.html Your cache manifest file can be located anywhere on your web server, but it must be served with…
Issue with China's Great Firewall (or other odd networking issue)
April 15, 2011
We periodically deploy an application to a computer located in China (from Canada). We deploy the changes using Subversion - we're talking a ~100Mb…
An issue with [a-z0-9]*@example.com in PHP
March 12, 2011
I can get the [a-z0-9]* part from [a-z0-9]*@example.com with regex but I want to limit the [a-z0-9]* part with 20 characters. Is it possible with…
SSL issue in Android
April 20, 2011
This was asked a lot of times (even by me), but there is still no solution. It's an issue (you have a valid certificate, you payed for it, but…
ASP.NET Regex Issue
May 23, 2011
I have a regular expression that works fine for me when used in ASP.NET Page Routing for URL rewriting. However, when I try and use it elsewhere in…
Redirection issue
April 9, 2011
I have a folder 'Main' [wherein the index.php resides] with a sub-folder called 'Users'. The 'Users' folder has two sub-folders 'A' and 'B'. When…
Sendmail TLS issue
March 3, 2011
I have a user that cannot authenticate. What I am getting is: did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA I have SASL installed for…
FTP connection issue
May 26, 2011
When I try to connect to my host i get a timeout error Status: Resolving address of ftp.thetascript.com Status: Connecting to 204.152.255.21:21...…
URL shortner issue in php
May 28, 2011
I am creating a urlshortner by using PHP.Here the IDE is EasyPHP 5.3.6.0 .I have copied the project in the path C:\Program…
Vote_fu_rails_3 issue
March 2, 2011
I'm having trouble with a plugin on a rails 3 app called vote_fu_rails_3. This is a rails 3 compatible version of vote_fu by peteonrails. Both…