Re: [Puppet Users] Re: cleaning puppet dashboard

2011-08-12 Thread Arnau Bria
On Thu, 11 Aug 2011 08:36:41 -0700 (PDT)
Luke Bigum wrote:

 Hi Arnau,
Hi Luke,
 
 This is not a Puppet Dashboard problem, it's a MySQL feature of
 InnoDB. You're using per-table InnoDB data files. InnoDB data files
 grow. They never, ever, ever shrink. So what you've got there is a
 22GB sparse file that MySQL will fill up with more resource_statuses
 rows. It won't use that space for any other table because you've for
 per-table InnoDB data files configured on.

You're right!! 
 
 I *think* one solution is to convert the resource_statuses to MyISAM
 then back to InnoDB again but I've never done it. Another way is to
 dump the database out, blow away the InnoDB data files and import the
 dump (see
 http://dev.mysql.com/doc/refman/5.5/en/innodb-data-log-reconfiguration.html).

I'll try to do so.
 
 Hope that helps,
it does.
 
 -Luke
Cheers,
Arnau

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Distributing a PHP file as template fails

2011-08-12 Thread Tom De Vylder

On 12 Aug 2011, at 01:06, vagn scott wrote:

 On 08/11/2011 04:42 AM, Tom De Vylder wrote:
 # cat include/init.php
 ?php
 $dbhost = '%= app_dbhost %';
 $dbname = '%= app_dbname %';
 $dbuser = '%= app_dbuser %';
 $dbpass = '%= app_dbpass %';
 ?
   
 
 Surely you mean (note the dash (-) ):
 
 ?php
$dbhost = '%= app_dbhost -%';
$dbname = '%= app_dbname -%';
$dbuser = '%= app_dbuser -%';
$dbpass = '%= app_dbpass -%';
 ?

I've always used the one without the dash.
Anyways, I do get the same error using -%.

Tom

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Distributing a PHP file as template fails

2011-08-12 Thread Tom De Vylder
On 11 Aug 2011, at 18:26, Daniel Pittman wrote:

 On Thu, Aug 11, 2011 at 08:42, Tom De Vylder t...@penumbra.be wrote:
 
 I'm trying to distribute a PHP file as a template.
 The problem I'm running into is that each variable in the PHP file is 
 recognized as a Puppet or ERB variable.
 
 That is pretty strange.  So, I tested this to be sure, and I can
 manage create a file using that template just fine.
 
 As you can see the actual ERB parts are filled in nicely but it fails on 
 PHP's variables.
 I've tried escaping the variables and equation marks. I've also renamed the 
 php file not to end with *.erb. To no avail.
 
 Is there a way to avoid this behavior?
 
 Well, it isn't expected behaviour, so you *should* be just fine.
 Obviously, though, not so much.
 
 Can you post the actual declaration that creates the file, and the
 cached YAML catalog from the node that fails?  Keep in mind that
 includes all the configuration data, so if you have passwords or
 whatever you might not want to do that.

I'm pretty sure it does contain passwords and other sensitive information.
Is there any other way?

The file declaration isn't anything out of the ordinary:

file {
/var/www/app/include:
ensure = directory;

/var/www/app/include/init.php:
ensure = present,
source = template (app/init.php.erb);
}

I've tried Vagn Scott's suggestion to use %= var -% instead of  %= var 
% and it still dies with the same error (below).
The file really is there and if it wasn't it should be created anyhow. Heck 
I've just tested with /tmp: instead just to be sure.

info: Applying configuration version '1313148609'
err: /Stage[main]/Savane::Config/File[/var/ww/app/include/init.php]: Could not 
evaluate: Cannot find file: Invalid path '?php
$sys_dbhost = 'localhost';
$sys_dbname = 'application';
$sys_dbuser = 'user1';
$sys_dbpass = 'spoofed';
?' Could not retrieve file metadata for ?php
$sys_dbhost = 'localhost';
$sys_dbname = 'application';
$sys_dbuser = 'user1';
$sys_dbpass = 'spoofed';
?: Cannot find file: Invalid path '?php
$sys_dbhost = 'localhost';
$sys_dbname = 'application';
$sys_dbuser = 'user1';
$sys_dbpass = 'spoofed';
?' at /etc/puppet/modules/savane/manifests/init.pp:91

TomDV

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Distributing a PHP file as template fails

2011-08-12 Thread Darren Chamberlain

On 8/12/2011 7:43 AM, Tom De Vylder wrote:

file {
/var/www/app/include:
ensure =  directory;

/var/www/app/include/init.php:
ensure =  present,
source =  template (app/init.php.erb);


content = template(app/init.php.erb);


}


If you use source, it evaluates the template, then looks for a file with 
that name.  I've been bitten by that many times as I change things from 
files to templates.


--
Darren Chamberlain dar...@boston.com

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Distributing a PHP file as template fails

2011-08-12 Thread Tom De Vylder
On 12 Aug 2011, at 13:49, Darren Chamberlain wrote:

 On 8/12/2011 7:43 AM, Tom De Vylder wrote:
 file {
  /var/www/app/include:
  ensure =  directory;
 
  /var/www/app/include/init.php:
  ensure =  present,
  source =  template (app/init.php.erb);
 
content = template(app/init.php.erb);
 
 }
 
 If you use source, it evaluates the template, then looks for a file with that 
 name.  I've been bitten by that many times as I change things from files to 
 templates.

That seemed to fix it right away.
Thanks!

TomDV

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: N could not find class errors before success, where N is the number of included modules

2011-08-12 Thread jcbollinger


On Aug 10, 9:17 am, astrostl jus...@bigblind.com wrote:
 Puppet 2.7.1 on all sides from Gems.  Ubuntu 10.04 hosts, Ruby
 1.8.7.249-2, RubyGems 1.3.5-1ubuntu2.

 Bug with details athttp://projects.puppetlabs.com/issues/8801.  Any
 ideas out there?  I'm stumped.


I agree that the behavior looks buggy, especially in that Puppet
behaves differently from run to run.  You may be able to work around
the bug by taking care to refer to your classes by their fully-
qualified names, structuring your modules in the canonical way (looks
like you may already be doing that), and wherever possible ditching
'import' in favor of autoloading.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: cleaning puppet dashboard

2011-08-12 Thread Arnau Bria
On Thu, 11 Aug 2011 08:36:41 -0700 (PDT)
Luke Bigum wrote:

 Hi Arnau,
Hi Luke,

[...] 
 dump the database out, blow away the InnoDB data files and import the
 dump (see
 http://dev.mysql.com/doc/refman/5.5/en/innodb-data-log-reconfiguration.html).

I'm dumping my dashboard data.  My cron prunes de DB and keeps 1 week
info. I have about ~100 nodes in that server and the dump is 6GB and
grwoing... is that size normal? I mean, what's the normal size for
the scenario I've described? (I know it depends on the amount os
resoruces, but do you have any approach?)


 Hope that helps,
 
 -Luke
Cheers,
Arnau

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] hasstatus not working as expected

2011-08-12 Thread Chad
All,

I have puppet watching various services on RHEL systems and restarting
them as necessary.

Quite a while back I wrote some custom scripts as wrappers for various
services so that I can have a custom running status.  These have
worked for quite a few months, but recently my iptables services have
been restarting every time puppet checks in.

Problem:

[me@host ~]$ sudo /usr/sbin/puppetd --test --noop
info: Caching catalog for host@fakedomain
info: Applying configuration version '1312979662'
notice: //iptables/Service[build_iptables]/ensure: is stopped, should
be running (noop)
notice: Finished catalog run in 3.09 seconds

Excerpt from manifest that does this:

service { build_iptables:
   enable  = true,
   ensure  = running,
   hasstatus = true,
}


'build_iptables' does a couple of things, but most importantly for
this problem it runs a regex to look for a particular rule to see if
it exists.  If said rule exists it returns that the service is
running, if that rule doesn't exist then it says it is not running and
restarts the 'build_iptables' service (which does things to fix the
issue along with restarts the real iptables service).

But if I run the same build_iptables script I see that it is running:

[me@host ~]$ sudo /sbin/service build_iptables status
iptables is running
[me@host ~]$ echo $?
0

[me@host ~]$ sudo /usr/sbin/puppetd --test --noop
info: Caching catalog for host.fakedomain
info: Applying configuration version '1312979662'
notice: //iptables/Service[build_iptables]/ensure: is stopped, should
be running (noop)
notice: Finished catalog run in 2.88 seconds

[me@host ~]$ sudo /sbin/service build_iptables status
iptables is running
[me@host ~]$ echo $?
0


This worked for a number of months, but recently broke.  The issue is
that when iptables restarts it drops it's state table and any
connections that would be allowed (through the ESTABLISHED or RELATED
rule) are no longer recognized and the packets are dropped.

Here is the relevant debug output:

debug: Service[build_iptables](provider=redhat): Executing '/sbin/
service build_iptables status'
debug: Puppet::Type::Service::ProviderRedhat: Executing '/sbin/
chkconfig build_iptables'
debug: //iptables/Service[build_iptables]: Changing ensure
debug: //iptables/Service[build_iptables]: 1 change(s)
notice: //iptables/Service[build_iptables]/ensure: is stopped, should
be running (noop)

And the log entry from the puppet service:

Aug 11 16:12:13 host/host puppetd[4113]: (//iptables/
Service[build_iptables]/ensure) ensure changed 'stopped' to 'running

Any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] hasstatus not working as expected

2011-08-12 Thread vagn scott

On 08/12/2011 09:32 AM, Chad wrote:

Any ideas?

   


For starters, see what happens when you run it in an

exec { build_iptables status: logoutput = true, }

--
vagn

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] unable to distribute custom facts

2011-08-12 Thread newguy
Guys
I made a custom fact using export;(export FACTER_envt=`hostname -s|cut
-c 1-2`;) on puppet master, and when I do facter envt it shows the
desired result, now my problem is that am unable to distribute it to
the client machines.

I read up a little on adding custom facts and found out the pluginsyc
would help me but it didnt, I have pluginsync=true on both
puppetmaster and client but still when I do sudo puppetd --test --
pluginsync on client it says the following:

err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
resource: Could not retrieve information from source(s) puppet://puppet/plugins

On client /var/lib/puppet/lib has no directory
On server /var/lib/puppet/lib has puppet and facter directories

sudo puppetd --configprint factpath on client is  /var/lib/puppet/lib/
facter and on server its the same.

Please help.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] unable to distribute custom facts

2011-08-12 Thread Guy Matz
Where exactly is you fact?  Is it in a module?  My recent experience
required placement of my facts in $modulepath/module/lib/facter . . .

On Fri, Aug 12, 2011 at 10:30 AM, newguy aimanparv...@gmail.com wrote:

 Guys
 I made a custom fact using export;(export FACTER_envt=`hostname -s|cut
 -c 1-2`;) on puppet master, and when I do facter envt it shows the
 desired result, now my problem is that am unable to distribute it to
 the client machines.

 I read up a little on adding custom facts and found out the pluginsyc
 would help me but it didnt, I have pluginsync=true on both
 puppetmaster and client but still when I do sudo puppetd --test --
 pluginsync on client it says the following:

 err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
 resource: Could not retrieve information from source(s)
 puppet://puppet/plugins

 On client /var/lib/puppet/lib has no directory
 On server /var/lib/puppet/lib has puppet and facter directories

 sudo puppetd --configprint factpath on client is  /var/lib/puppet/lib/
 facter and on server its the same.

 Please help.

 Thanks

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: unable to distribute custom facts

2011-08-12 Thread newguy
Yes fact exists as a environment variable only
Any suggestions anyone???
On Aug 12, 7:50 am, Guy Matz gm...@matz.org wrote:
 Oh, wait . . .  that fact exists solely as an environment variable?  You
 haven't put that code in a file for distribution?  Then please ignore my
 previous response.  Sorry



 On Fri, Aug 12, 2011 at 10:30 AM, newguy aimanparv...@gmail.com wrote:
  Guys
  I made a custom fact using export;(export FACTER_envt=`hostname -s|cut
  -c 1-2`;) on puppet master, and when I do facter envt it shows the
  desired result, now my problem is that am unable to distribute it to
  the client machines.

  I read up a little on adding custom facts and found out the pluginsyc
  would help me but it didnt, I have pluginsync=true on both
  puppetmaster and client but still when I do sudo puppetd --test --
  pluginsync on client it says the following:

  err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
  resource: Could not retrieve information from source(s)
  puppet://puppet/plugins

  On client /var/lib/puppet/lib has no directory
  On server /var/lib/puppet/lib has puppet and facter directories

  sudo puppetd --configprint factpath on client is  /var/lib/puppet/lib/
  facter and on server its the same.

  Please help.

  Thanks

  --
  You received this message because you are subscribed to the Google Groups
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: hasstatus not working as expected

2011-08-12 Thread Chad
[me@host ~]$ sudo /usr/sbin/puppetd --test --noop
info: Caching catalog for host.fakedomain
info: Applying configuration version '1313165427'
notice: //iptables/Service[build_iptables]/ensure: is stopped, should
be running (noop)
notice: //iptables/Exec[/etc/init.d/build_iptables status]/returns: is
notrun, should be 0 (noop)
notice: Finished catalog run in 2.85 seconds

is notrun?  I am not sure what that means...

On Aug 12, 10:23 am, vagn scott vagnsc...@gmail.com wrote:
 On 08/12/2011 09:32 AM, Chad wrote:

  Any ideas?

 For starters, see what happens when you run it in an

 exec { build_iptables status: logoutput = true, }

 --
 vagn

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] could not find file

2011-08-12 Thread Alan Batie
I'm playing with puppet 2.7.1 on centos 5.6; as I read the docs at
http://docs.puppetlabs.com/learning/modules1.html, the command:

puppet apply --verbose --noop -e include global::admins

should look for a manifest in /etc/puppet/modules/global/manifests/
admins.pp

Instead, I get:

Could not find class global::admins for admin00.intranet.peak.org at
line 1 on node admin00.intranet.peak.org

When I strace puppet, I find it's trying to stat global::admins as a
filename, not parsing it into the module structure?!?

What am I missing?  Thanks...

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] fighting packaging

2011-08-12 Thread Craig White
Clearly not a problem caused by puppet but something I can't apparently deploy 
with puppet unless someone has an idea.

Trying to automate a way to deploy mod_mono for apache

from CLI, the problem seems obvious...

apt-get install -y --assume-yes libapache2-mod-mono mono-apache-server 
libmono-firebirdsql1.7-cil

a massive pile of packages installs and it finally arrives at the truth moment:

Configuration file `/etc/apache2/mods-available/mod_mono.conf'
 == File on system created by you or by a script.
 == File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
Y or I  : install the package maintainer's version
N or O  : keep your currently-installed version
  D : show the differences between the versions
  Z : background this process to examine the situation
 The default action is to keep your current version.
*** mod_mono.conf (Y/I/N/O/D/Z) [default=N] ? 

So it appears that the same target, mod_mono.conf is being created both by 
script and a file in the package itself and it appears that all of the '-y' or 
'--assume-yes' logic in the command itself will not allow an install to 
progress without an interactive answer to the question - the answer to which is 
essentially meaningless because I can control the file anyway with puppet.

Anyone have an idea how to defeat well intentioned but defective packager logic?

-- 
Craig White ~~  craig.wh...@ttiltd.com
1.800.869.6908 ~~~ www.ttiassessments.com 

Need help communicating between generations at work to achieve your desired 
success? Let us help!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] fighting packaging

2011-08-12 Thread Nathan Clemons
Isn't there an adminfile option to the package resource that will let you
pass responses as if it were an interactive session? Not sure if it's
supported for the apt provider, but worth looking into if you haven't
already.

--
Nathan Clemons
http://www.livemocha.com
The worlds largest online language learning community



On Fri, Aug 12, 2011 at 9:53 AM, Craig White craig.wh...@ttiltd.com wrote:

 Clearly not a problem caused by puppet but something I can't apparently
 deploy with puppet unless someone has an idea.

 Trying to automate a way to deploy mod_mono for apache

 from CLI, the problem seems obvious...

 apt-get install -y --assume-yes libapache2-mod-mono mono-apache-server
 libmono-firebirdsql1.7-cil

 a massive pile of packages installs and it finally arrives at the truth
 moment:

 Configuration file `/etc/apache2/mods-available/mod_mono.conf'
  == File on system created by you or by a script.
  == File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
Y or I  : install the package maintainer's version
N or O  : keep your currently-installed version
  D : show the differences between the versions
  Z : background this process to examine the situation
  The default action is to keep your current version.
 *** mod_mono.conf (Y/I/N/O/D/Z) [default=N] ?

 So it appears that the same target, mod_mono.conf is being created both by
 script and a file in the package itself and it appears that all of the '-y'
 or '--assume-yes' logic in the command itself will not allow an install to
 progress without an interactive answer to the question - the answer to which
 is essentially meaningless because I can control the file anyway with
 puppet.

 Anyone have an idea how to defeat well intentioned but defective packager
 logic?

 --
 Craig White ~~  craig.wh...@ttiltd.com
 1.800.869.6908 ~~~ www.ttiassessments.com

 Need help communicating between generations at work to achieve your desired
 success? Let us help!

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] could not find file

2011-08-12 Thread Scott Smith
It's the first line in admins.pp 'class global::admins {' ?
On Aug 12, 2011 9:44 AM, Alan Batie a...@batie.org wrote:
 I'm playing with puppet 2.7.1 on centos 5.6; as I read the docs at
 http://docs.puppetlabs.com/learning/modules1.html, the command:

 puppet apply --verbose --noop -e include global::admins

 should look for a manifest in /etc/puppet/modules/global/manifests/
 admins.pp

 Instead, I get:

 Could not find class global::admins for admin00.intranet.peak.org at
 line 1 on node admin00.intranet.peak.org

 When I strace puppet, I find it's trying to stat global::admins as a
 filename, not parsing it into the module structure?!?

 What am I missing? Thanks...

 --
 You received this message because you are subscribed to the Google Groups
Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] could not find file

2011-08-12 Thread Craig White

On Aug 11, 2011, at 5:04 PM, Alan Batie wrote:

 I'm playing with puppet 2.7.1 on centos 5.6; as I read the docs at
 http://docs.puppetlabs.com/learning/modules1.html, the command:
 
 puppet apply --verbose --noop -e include global::admins
 
 should look for a manifest in /etc/puppet/modules/global/manifests/
 admins.pp
 
 Instead, I get:
 
 Could not find class global::admins for admin00.intranet.peak.org at
 line 1 on node admin00.intranet.peak.org
 
 When I strace puppet, I find it's trying to stat global::admins as a
 filename, not parsing it into the module structure?!?
 
 What am I missing?  Thanks...

probably not useful to you but I had the same issue with 2.7.1

If I ran it again, it apparently cached that class and the error was with the 
next class... and so on.

Eventually, I could keep running puppet agent (i.e puppet apply) and eventually 
it would get a complete catalog and run.

I ended up going back to 2.6.9

Craig

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: cleaning puppet dashboard

2011-08-12 Thread Scott Smith
FWIW, I don't think that task touches this table.

Also, I apologize for writing such a crappy rake task, can't believe it's
still there :-P
On Aug 12, 2011 6:28 AM, Arnau Bria arnaub...@pic.es wrote:
 On Thu, 11 Aug 2011 08:36:41 -0700 (PDT)
 Luke Bigum wrote:

 Hi Arnau,
 Hi Luke,

 [...]
 dump the database out, blow away the InnoDB data files and import the
 dump (see

http://dev.mysql.com/doc/refman/5.5/en/innodb-data-log-reconfiguration.html
).

 I'm dumping my dashboard data. My cron prunes de DB and keeps 1 week
 info. I have about ~100 nodes in that server and the dump is 6GB and
 grwoing... is that size normal? I mean, what's the normal size for
 the scenario I've described? (I know it depends on the amount os
 resoruces, but do you have any approach?)


 Hope that helps,

 -Luke
 Cheers,
 Arnau

 --
 You received this message because you are subscribed to the Google Groups
Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] ENC struggles

2011-08-12 Thread Craig White
Seems that this might be a puppet problem more than a Foreman problem and 
though I have gotten some good help on the foreman list, I may be able to find 
an answer here.

Puppet 2.6.9 (master/clients)
Foreman 0.3
Ruby 1.87 (REE)
puppet  foreman using apache  passenger (8140 puppet, 8142 foreman)

Basically, using foreman for ENC...

puppet.conf (master)

  external_nodes = /etc/puppet/node.rb
  node_terminus  = exec

If I use http URL's, I have no problems. Clients get catalogs, get 
configurations, update, report to log  foreman.

If I use https URL's, my puppet clients get an error, can't get catalog but 
they do still report to log  foreman and the web application works fine.

ERROR specifically is...
  Could not retrieve catalog from remote server: Error 400 on SERVER: Could not 
find node 'ubuntu.ttinet'; cannot compile

Now I don't have a problem getting the catalog via curl...

curl -k https://ubuntu.ttinet:8142/node/ubuntu.ttinet?format=yml
--- 
  parameters: 
puppetmaster: ubuntu.ttinet
hostgroup: puppetmaster
apt::key: 7F0CEB10
  classes: 
- sudoers::hostgroup
- subversion
- postfix
- ntp
- git
- etc
- apt
- sudoers
- ldap::configure
- ldap::client_install
- mysql
- apache::service
- gems::passenger
- apache
- firebird
- mongodb
  environment: production

and I could even sort of substitute this methodology in foreman's ENC retrieval 
code section except that it fails miserably if the node doesn't exist rather 
than have puppetmaster supply the 'default node' classes.

-- 
Craig White ~~  craig.wh...@ttiltd.com
1.800.869.6908 ~~~ www.ttiassessments.com 

Need help communicating between generations at work to achieve your desired 
success? Let us help!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] could not find file

2011-08-12 Thread Scott Smith
Hm, weird. Been running a small cluster on 2.7.1 for a month or so and
haven't experienced this myself.
On Aug 12, 2011 10:03 AM, Craig White craig.wh...@ttiltd.com wrote:

 On Aug 11, 2011, at 5:04 PM, Alan Batie wrote:

 I'm playing with puppet 2.7.1 on centos 5.6; as I read the docs at
 http://docs.puppetlabs.com/learning/modules1.html, the command:

 puppet apply --verbose --noop -e include global::admins

 should look for a manifest in /etc/puppet/modules/global/manifests/
 admins.pp

 Instead, I get:

 Could not find class global::admins for admin00.intranet.peak.org at
 line 1 on node admin00.intranet.peak.org

 When I strace puppet, I find it's trying to stat global::admins as a
 filename, not parsing it into the module structure?!?

 What am I missing? Thanks...
 
 probably not useful to you but I had the same issue with 2.7.1

 If I ran it again, it apparently cached that class and the error was with
the next class... and so on.

 Eventually, I could keep running puppet agent (i.e puppet apply) and
eventually it would get a complete catalog and run.

 I ended up going back to 2.6.9

 Craig

 --
 You received this message because you are subscribed to the Google Groups
Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: need urgent help with including Ruby DSL class from puppet manifests

2011-08-12 Thread piavlo

 Thanks Ken that finaly solved the problem with the ruby dsl class and
it's working now.

I don't quite understand why you think implementing ruby function is
better fit - what I need to do is iterate over
all records in couchdb and create a puppet resource for each one of
them - that's the reason I use ruby dsl and not puppet defines.
But how is puppet function going to help me - I won't be able to reuse
it in other places - so I don't want to create
a functions instead of each hostclass i need.

Thanks

On Aug 12, 12:17 am, Ken Barber k...@puppetlabs.com wrote:
 Is it this line?

 raise Puppet:Error, Unsupported ssa nagios check type $type

 Should be double colon ... Puppet::Error.

 Looking at your code, I can't help but think a function is a better
 fit then Ruby DSL.

 ken.









 On Thu, Aug 11, 2011 at 9:34 PM, piavlo lolitus...@gmail.com wrote:
  Hi Ken,

  Thank you so much for your reply
  I did like you said BUT i was still getting the error

  err: Must pass a parameter or all necessary values at /etc/puppet/
  modules/nagios/manifests/server.pp:19 on node mon1a.internal

  Then I started to insert notice statement in the ruby DSL class - it
  turns out I a logical erro in the code.
  Arghhh - I have been so fooled by the totally misguiding error
  message.
  Shouldn't puppet err indicate that there is problem in /etc/puppet/
  modules/nagios/manifests/ssa_nagios_checks.rb and not in /etc/puppet/
  modules/nagios/manifests/server.pp?

  Anyway now that the ruby error is fixed I get new error
  err: undefined method `Puppet' for #Puppet::DSL::ResourceAPI:
  0xb73f50e0 at /etc/puppet/modules/nagios/manifests/server.pp:15 on
  node mon1a.internal

  What does this error means?

  Here is the real ruby dsl class code - in case it's again a problem
  with the class :)

  
  require 'json'
  require 'open-uri'

  hostclass :'nagios::ssa_nagios_checks' do

   nagios_confdir = scope.lookupvar('nagios::params::nrpe_confdir')

   url = http://localhost:5984/nagios_alerts/_all_docs?
  include_docs=true
   result = JSON.parse(open(URI.parse(url)).read)

   result['rows'].each do |x|

     type = x['doc']['type']
     args = x['doc']['args']
     warning_threshold = x['doc']['warning_threshold']
     critical_threshold = x['doc']['critical_threshold']

     contacts = x['doc']['contacts']
     contact_groups = x['doc']['contact_groups']
     notification_period = x['doc']['notifications_period']

     case type
     when mysql
       mysql_user = 'nagios'
       mysql_password = ''
       check_command = check_mysql_health_sql_tresholds!#{mysql_user}!
  #{mysql_password}!'#{args}'!#{warning_threshold}!
  #{critical_threshold}
     when api
       check_command = blah-blah
     else
       raise Puppet:Error, Unsupported ssa nagios check type $type
     end

     nagios_service( ssa_#{x['doc']['_id']},
       :target              = ${nagios_confdir}/app_alerts/ssa/
  services/${name}.cfg,
       :host_name           = x['doc']['hosts'],
       :service_description = x['doc']['desc'],
       :use                 = 'generic-service',
       :check_command       = check_command,
       :require             = File[#{nagios_confdir}/app_alerts/ssa/
  services] )

   end

  end
  

  Thanks
  Alex

  On Aug 11, 9:13 pm, Ken Barber k...@puppetlabs.com wrote:
  If you look at this example:

   I have a Ruby class in nagios module - it's located in nagios/
   manifests/ssa_nagios_checks.rb
   and looks like this

   hostclass :ssa_nagios_checks do
   ...
   end

   In nagios/manifests/init.pp I have

   class nagios::server {
   ...
      include ssa_nagios_checks
   ...
   }

  The autoloader/module layout recommendations/rules haven't been followed.

  You actually want something more like:

  nagios/manifests/server.pp:

    class nagios::server {
      include nagios::ssa_nagios_checks
    }

  nagios/manifests/ssa_nagios_checks.rb:

    hostclass :'nagios::ssa_nagios_checks' do
      notice([should work])
    end

  This should work. Can you test it?

  Remember that sub-classes belong in their own file ... and only the
  class with the same name as the module belongs in init.pp. Also - you
  have to fully qualify class names when declaring them in their rb/pp
  file.

  ken.

  --
  Join us for PuppetConf, September 22nd and 23rd in Portland, 
  OR:http://bit.ly/puppetconfsig;

  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/puppet-users?hl=en.

 --
 Join us for PuppetConf, September 22nd and 23rd in Portland, 
 OR:http://bit.ly/puppetconfsig;

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to 

Re: [Puppet Users] hasstatus not working as expected

2011-08-12 Thread Stefan Schulte
On Fri, Aug 12, 2011 at 06:32:57AM -0700, Chad wrote:
 All,
 
 I have puppet watching various services on RHEL systems and restarting
 them as necessary.
 
 Quite a while back I wrote some custom scripts as wrappers for various
 services so that I can have a custom running status.  These have
 worked for quite a few months, but recently my iptables services have
 been restarting every time puppet checks in.
 
 Problem:
 
 [me@host ~]$ sudo /usr/sbin/puppetd --test --noop
 info: Caching catalog for host@fakedomain
 info: Applying configuration version '1312979662'
 notice: //iptables/Service[build_iptables]/ensure: is stopped, should
 be running (noop)
 notice: Finished catalog run in 3.09 seconds
 
 Excerpt from manifest that does this:
 
 service { build_iptables:
enable  = true,
ensure  = running,
hasstatus = true,
 }
 
 
 'build_iptables' does a couple of things, but most importantly for
 this problem it runs a regex to look for a particular rule to see if
 it exists.  If said rule exists it returns that the service is
 running, if that rule doesn't exist then it says it is not running and
 restarts the 'build_iptables' service (which does things to fix the
 issue along with restarts the real iptables service).
 
 But if I run the same build_iptables script I see that it is running:
 
 [me@host ~]$ sudo /sbin/service build_iptables status
 iptables is running
 [me@host ~]$ echo $?
 0
 
 [me@host ~]$ sudo /usr/sbin/puppetd --test --noop
 info: Caching catalog for host.fakedomain
 info: Applying configuration version '1312979662'
 notice: //iptables/Service[build_iptables]/ensure: is stopped, should
 be running (noop)
 notice: Finished catalog run in 2.88 seconds
 
 [me@host ~]$ sudo /sbin/service build_iptables status
 iptables is running
 [me@host ~]$ echo $?
 0
 
 
 This worked for a number of months, but recently broke.  The issue is
 that when iptables restarts it drops it's state table and any
 connections that would be allowed (through the ESTABLISHED or RELATED
 rule) are no longer recognized and the packets are dropped.
 
 Here is the relevant debug output:
 
 debug: Service[build_iptables](provider=redhat): Executing '/sbin/
 service build_iptables status'
 debug: Puppet::Type::Service::ProviderRedhat: Executing '/sbin/
 chkconfig build_iptables'
 debug: //iptables/Service[build_iptables]: Changing ensure
 debug: //iptables/Service[build_iptables]: 1 change(s)
 notice: //iptables/Service[build_iptables]/ensure: is stopped, should
 be running (noop)
 
So puppet actually uses »/sbin/service build_iptables status« to check
if your service is running.

Is it possible that your initscript depends on a specific environment
(like a special PATH variable?). Maybe your script doesnt work when run
through puppet so it doesnt return with zero and puppet thinks the
service is not running.

-Stefan


pgpNgj2RYf75K.pgp
Description: PGP signature


Re: [Puppet Users] fighting packaging

2011-08-12 Thread Craig White
Appear that 'adminfile' option is a Solaris only thing.

I found that ubuntu/debian has debconf-get-selections/debconf-set-selections 
packages which might actually get me there but it introduces new package 
dependencies and would take more time than it is reasonably worth as we will 
never have many servers with mod-mono anyway.

I think I will just manually install on the servers that will need it.

Thanks

Craig

On Aug 12, 2011, at 9:56 AM, Nathan Clemons wrote:

 Isn't there an adminfile option to the package resource that will let you 
 pass responses as if it were an interactive session? Not sure if it's 
 supported for the apt provider, but worth looking into if you haven't already.
 
 --
 Nathan Clemons
 http://www.livemocha.com
 The worlds largest online language learning community
 
 
 
 On Fri, Aug 12, 2011 at 9:53 AM, Craig White craig.wh...@ttiltd.com wrote:
 Clearly not a problem caused by puppet but something I can't apparently 
 deploy with puppet unless someone has an idea.
 
 Trying to automate a way to deploy mod_mono for apache
 
 from CLI, the problem seems obvious...
 
 apt-get install -y --assume-yes libapache2-mod-mono mono-apache-server 
 libmono-firebirdsql1.7-cil
 
 a massive pile of packages installs and it finally arrives at the truth 
 moment:
 
 Configuration file `/etc/apache2/mods-available/mod_mono.conf'
  == File on system created by you or by a script.
  == File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
Y or I  : install the package maintainer's version
N or O  : keep your currently-installed version
  D : show the differences between the versions
  Z : background this process to examine the situation
  The default action is to keep your current version.
 *** mod_mono.conf (Y/I/N/O/D/Z) [default=N] ?
 
 So it appears that the same target, mod_mono.conf is being created both by 
 script and a file in the package itself and it appears that all of the '-y' 
 or '--assume-yes' logic in the command itself will not allow an install to 
 progress without an interactive answer to the question - the answer to which 
 is essentially meaningless because I can control the file anyway with puppet.
 
 Anyone have an idea how to defeat well intentioned but defective packager 
 logic?

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Service resource throws error for ups but service starts

2011-08-12 Thread treydock
I have a puppet module to manage Network UPS Tools, but am having
trouble getting Puppet to be able to start the ups service without
error.  What's strange is the service starts just fine, but Puppet
returns an error.

Here's the service resource I defined...


package { 'nut-client':ensure  = installed,
}

service { 'ups':
ensure  = running,
enable  = true,
hasrestart  = true,
require = Package['nut-client'],
}


The error when I run puppet is as follows...


debug: Service[ups](provider=redhat): Executing '/sbin/service ups
start'
err: /Stage[main]/Nut::Slave/Service[ups]/ensure: change from stopped
to running failed: Could not start Service[ups]: Execution of '/sbin/
service ups start' returned 1:  at /etc/puppet/modules/nut/manifests/
classes/slave.pp:12

I do not know if this is the fault of a bad return code in the init
script...here's the init script used...


### BEGIN INIT INFO
# Provides: ups
# Required-Start: $syslog $network $named
# Required-Stop: $local_fs
# Default-Stop: 0 1 6
# Short-Description: Starts the Network UPS tools
# Description: Network UPS Tools is a collection of programs which
provide a common \
#   interface for monitoring and administering UPS hardware.
### END INIT INFO

# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
else
exit 0
fi

# Get config.
if [ -f /etc/sysconfig/ups ]; then
. /etc/sysconfig/ups
else
SERVER=no
fi

start() {
if [ $SERVER = yes ]; then
echo -n $Starting UPS driver controller: 
daemon /sbin/upsdrvctl start  /dev/null 21  success || 
failure
RETVAL=$?
echo

prog=upsd
echo -n $Starting $prog: 
daemon /usr/sbin/upsd $UPSD_OPTIONS  /dev/null 21  success 
||
failure
if [ $RETVAL = 0 ]; then
RETVAL=$?
fi
echo

echo -n $Starting UPS monitor (master): 
daemon /usr/sbin/upsmon  /dev/null 21  success || failure
if [ $RETVAL = 0 ]; then
RETVAL=$?
fi
echo
else
echo -n $Starting UPS monitor (slave): 
daemon /usr/sbin/upsmon  /dev/null 21  success || failure
echo
fi

[ $RETVAL = 0 ]  touch /var/lock/subsys/ups
}

stop() {
echo -n $Stopping UPS monitor: 
killproc upsmon
echo

if [ $SERVER = yes ]; then
prog=upsd
echo -n $Stopping $prog: 
killproc upsd  /dev/null 21  success || failure
RETVAL=$?
echo

echo -n $Shutting down upsdrvctl: 
/sbin/upsdrvctl stop  /dev/null 21  success || failure
if [ $RETVAL = 0 ]; then
RETVAL=$?
fi
echo
fi
[ $RETVAL = 0 ]  rm -f /var/lock/subsys/ups
}

restart() {
stop
start
}

reload() {
# FIXME: upsd and upsmon always return 0
# = can't tell if reload was successful
if [ $SERVER = yes ]; then
action Reloading upsd: /usr/sbin/upsd -c reload
RETVAL=$?
fi
action Reloading upsmon: /usr/sbin/upsmon -c reload
if [ $RETVAL = 0 ]; then
RETVAL=$?
fi
}

# See how we are called.
case $1 in
start)
start ;;

stop)
stop ;;

restart)
restart ;;

try-restart)
[ -f /var/lock/subsys/ups ]  restart || :
;;

reload)
reload ;;

force-reload)
restart ;;

status)
if [ $SERVER = yes ]; then
status upsd
fi
status upsmon
;;

*)
echo $Usage: $0 
{start|stop|restart|try-restart|reload|force-reload|
status}
RETVAL=3
esac

exit $RETVAL


Thanks
- Trey

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] need help with using tamplate function in Ruby DSL

2011-08-12 Thread piavlo

 HI,

I'm trying to use tamplate function in ruby dsl but I miserably fail.
Then I just invoke it without using it in any resource like this

template ['nagios/conf.d/app_alerts/ssa_nagios_contact.erb'],

it works and i see


debug: Scope(Class[Nagios::Ssa_nagios_contacts]): Retrieving template
nagios/conf.d/app_alerts/ssa_nagios_contact.erb
debug: template[/etc/puppet/modules/nagios/templates/conf.d/app_alerts/
ssa_nagios_contact.erb]: Bound template variables for /etc/puppet/
modules/nagios/templates/conf.d/app_alerts/ssa_nagios_contact.erb in
0.00
seconds
debug: template[/etc/puppet/modules/nagios/templates/conf.d/app_alerts/
ssa_nagios_contact.erb]: Interpolated template /etc/puppet/modules/
nagios/templates/conf.d/app_alerts/ssa_nagios_contact.erb in 0.00
seconds
...

But obviously i need to use it inside resource - which does not work

file( #{nagios_confdir}/app_alerts/ssa/contacts/#{x['doc']
['_id']}.cfg,
  :content = template ['nagios/conf.d/app_alerts/
ssa_nagios_contact.erb'],
  :ensure  = :file,
  :owner   = 'root',
  :group   = 'root',
  :mode= 0755,
  :require = File[#{nagios_confdir}/app_alerts/ssa/contacts] )

  end

this fails with:

debug: importing '/etc/puppet/modules/nagios/manifests/
ssa_nagios_contacts.rb' in environment production
err: (eval):53:in `parse_ruby_file': compile error
(eval):42: syntax error, unexpected tLBRACK, expecting kDO or '{' or
'('
  :content = template ['nagios/conf.d/app_alerts/
ssa_...
 
^
(eval):42: syntax error, unexpected ',', expecting
kEND
(eval):44: syntax error, unexpected ',', expecting
kEND
(eval):45: syntax error, unexpected ',', expecting
kEND
(eval):47: syntax error, unexpected ')', expecting
kEND
(eval):53: syntax error, unexpected $end, expecting kEND

Please help.

Thanks
Alex

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] need help with using tamplate function in Ruby DSL

2011-08-12 Thread Craig White
template should be a string, not an array

content = template('nagios/ssa_nagios_contact.erb) # assuming it's in 
modules/nagios/templates

also, I think your 'require' should probably look like

require = File[#{nagios_confdir}/app_alerts/ssa/contacts],

but maybe your way will work

Craig

On Aug 12, 2011, at 11:06 AM, piavlo wrote:

 
 HI,
 
 I'm trying to use tamplate function in ruby dsl but I miserably fail.
 Then I just invoke it without using it in any resource like this
 
 template ['nagios/conf.d/app_alerts/ssa_nagios_contact.erb'],
 
 it works and i see
 
 
 debug: Scope(Class[Nagios::Ssa_nagios_contacts]): Retrieving template
 nagios/conf.d/app_alerts/ssa_nagios_contact.erb
 debug: template[/etc/puppet/modules/nagios/templates/conf.d/app_alerts/
 ssa_nagios_contact.erb]: Bound template variables for /etc/puppet/
 modules/nagios/templates/conf.d/app_alerts/ssa_nagios_contact.erb in
 0.00
 seconds
 debug: template[/etc/puppet/modules/nagios/templates/conf.d/app_alerts/
 ssa_nagios_contact.erb]: Interpolated template /etc/puppet/modules/
 nagios/templates/conf.d/app_alerts/ssa_nagios_contact.erb in 0.00
 seconds
 ...
 
 But obviously i need to use it inside resource - which does not work
 
 file( #{nagios_confdir}/app_alerts/ssa/contacts/#{x['doc']
 ['_id']}.cfg,
  :content = template ['nagios/conf.d/app_alerts/
 ssa_nagios_contact.erb'],
  :ensure  = :file,
  :owner   = 'root',
  :group   = 'root',
  :mode= 0755,
  :require = File[#{nagios_confdir}/app_alerts/ssa/contacts] )
 
  end
 
 this fails with:
 
 debug: importing '/etc/puppet/modules/nagios/manifests/
 ssa_nagios_contacts.rb' in environment production
 err: (eval):53:in `parse_ruby_file': compile error
 (eval):42: syntax error, unexpected tLBRACK, expecting kDO or '{' or
 '('
  :content = template ['nagios/conf.d/app_alerts/
 ssa_...
 
 ^
 (eval):42: syntax error, unexpected ',', expecting
 kEND
 (eval):44: syntax error, unexpected ',', expecting
 kEND
 (eval):45: syntax error, unexpected ',', expecting
 kEND
 (eval):47: syntax error, unexpected ')', expecting
 kEND
 (eval):53: syntax error, unexpected $end, expecting kEND
 
 Please help.
 
 Thanks
 Alex
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.
 

-- 
Craig White ~~  craig.wh...@ttiltd.com
1.800.869.6908 ~~~ www.ttiassessments.com 

Need help communicating between generations at work to achieve your desired 
success? Let us help!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Service resource throws error for ups but service starts

2011-08-12 Thread Daniel Pittman
On Fri, Aug 12, 2011 at 13:55, treydock treyd...@gmail.com wrote:

 I have a puppet module to manage Network UPS Tools, but am having
 trouble getting Puppet to be able to start the ups service without
 error.  What's strange is the service starts just fine, but Puppet
 returns an error.

 I do not know if this is the fault of a bad return code in the init
 script...here's the init script used...

It smells like one, but I can't see it obviously from that script.
Can you try stopping NUT, then running the service command puppet
does, and checking what 'echo $?' is?

If that isn't 0, your init script isn't returning correctly.

Daniel
-- 
⎋ Puppet Labs Developer – http://puppetlabs.com
♲ Made with 100 percent post-consumer electrons

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] fighting packaging

2011-08-12 Thread Daniel Pittman
You should file a bug report against the package with Debian; we set
the noninteractive, and the force yes, bits that absolutely
*should* make it work fine in these circumstances.

I am sorry that it doesn't work; if you find something we didn't do,
that makes the prompt go away, please let us know. :)

Daniel

On Fri, Aug 12, 2011 at 13:38, Craig White craig.wh...@ttiltd.com wrote:
 Appear that 'adminfile' option is a Solaris only thing.

 I found that ubuntu/debian has debconf-get-selections/debconf-set-selections 
 packages which might actually get me there but it introduces new package 
 dependencies and would take more time than it is reasonably worth as we will 
 never have many servers with mod-mono anyway.

 I think I will just manually install on the servers that will need it.

 Thanks

 Craig

 On Aug 12, 2011, at 9:56 AM, Nathan Clemons wrote:

 Isn't there an adminfile option to the package resource that will let you 
 pass responses as if it were an interactive session? Not sure if it's 
 supported for the apt provider, but worth looking into if you haven't 
 already.

 --
 Nathan Clemons
 http://www.livemocha.com
 The worlds largest online language learning community



 On Fri, Aug 12, 2011 at 9:53 AM, Craig White craig.wh...@ttiltd.com wrote:
 Clearly not a problem caused by puppet but something I can't apparently 
 deploy with puppet unless someone has an idea.

 Trying to automate a way to deploy mod_mono for apache

 from CLI, the problem seems obvious...

 apt-get install -y --assume-yes libapache2-mod-mono mono-apache-server 
 libmono-firebirdsql1.7-cil

 a massive pile of packages installs and it finally arrives at the truth 
 moment:

 Configuration file `/etc/apache2/mods-available/mod_mono.conf'
  == File on system created by you or by a script.
  == File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : background this process to examine the situation
  The default action is to keep your current version.
 *** mod_mono.conf (Y/I/N/O/D/Z) [default=N] ?

 So it appears that the same target, mod_mono.conf is being created both by 
 script and a file in the package itself and it appears that all of the '-y' 
 or '--assume-yes' logic in the command itself will not allow an install to 
 progress without an interactive answer to the question - the answer to which 
 is essentially meaningless because I can control the file anyway with puppet.

 Anyone have an idea how to defeat well intentioned but defective packager 
 logic?

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.





-- 
⎋ Puppet Labs Developer – http://puppetlabs.com
♲ Made with 100 percent post-consumer electrons

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Vanishing facts

2011-08-12 Thread John T. Guthrie
On Thu, 2011-08-11 at 17:45 -0500, Nan Liu wrote: 
 On Thu, Aug 11, 2011 at 4:59 PM, John T. Guthrie jguth...@book.com wrote:

Thank you very much for the quick response.

  Hello all,
 
  I am running puppet 2.7.1 with mongrel and an apache proxy.  I have been
  seeing an issue where it appears that the puppetmaster is completely
  ignoring any facts that are sent to it.
 
  When a client connects, any configuration that relies on facts shows
  those variables as being empty strings.  (I have been testing this with
  a simple notify resource that prints out the IP address and the FQDN.
  Both of these are coming up as empty strings.)  If I check the list of
  facts for a node through the REST API, it comes up as an empty list.
  Moreover, /var/lib/puppet/facts is persistently empty.  This has been
  happening with every client that I have checked.
 
 Can you show your puppet manifests? Are you using $::ipaddress $::fqdn?

Here is the manifest code that I have been using for testing:

notify {
Echo-IP:
message  = IP = $ipaddress,
withpath = true;
Echo-fqdn:
message  = FQDN = $fqdn,
withpath = true;
}

And here is the resulting output when I run puppetd --test:

notice: /Stage[main]/Subversion::Server/Notify[Echo-fqdn]/message: FQDN = 
notice: /Stage[main]/Subversion::Server/Notify[Echo-fqdn]/message: defined 
'message' as 'FQDN = '
info: /Stage[main]/Subversion::Server/Notify[Echo-fqdn]: Scheduling refresh of 
(completed_Subversion::Server)
notice: /Stage[main]/Subversion::Server/Notify[Echo-IP]/message: IP = 
notice: /Stage[main]/Subversion::Server/Notify[Echo-IP]/message: defined 
'message' as 'IP = '
info: /Stage[main]/Subversion::Server/Notify[Echo-IP]: Scheduling refresh of 
(completed_Subversion::Server)

So no, I'm not using the $::ipaddress form of the facts.  Should I be?
I take it that this is a change since 0.24 or 0.25.  (When I was last
working with puppet.)

When I change one of the resources to read:

Echo-IP:
message  = IP = $::ipaddress,
withpath = true;

I still get the same result:

notice: /Stage[main]/Subversion::Server/Notify[Echo-IP]/message: IP = 
notice: /Stage[main]/Subversion::Server/Notify[Echo-IP]/message: defined 
'message' as 'IP = '
info: /Stage[main]/Subversion::Server/Notify[Echo-IP]: Scheduling refresh of 
(completed_Subversion::Server)

  If run a packet capture on the puppetmaster paying attention to the
  puppetmaster ports, then I definitely see the puppetmaster receive the
  facts in b64_zlib_yaml format.  I can even decode the facts string and
  get the correct set of facts.  So the puppetmaster is definitely
  receiving the facts.  However, in the same packet capture, I see the
  puppetmaster return json for resources as if it had not received any
  facts at all.
 
  I have even gone so far as to blow away my entire /var/lib/puppet
  directory (except for the ssl), and try starting fresh to no avail.
 
  Does anyone have any suggestions for how I can fix this?  I am attaching
  my puppet.conf in case that will help.  Thanks in advance for any advice
  that anyone has.
 
 Use this tip and see what puppet facts you are getting back on master:
 
 http://www.puppetcookbook.com/posts/see-all-client-variables.html

When I check this, no facts show up.  Only variables that I have set
manually or variables set by the server, like $serverip.

 The facts you get from the client should also reside in
 $vardir/yaml/facts, and you can examine them to see what you have.

On the puppet master:
# ls -l /var/lib/puppet/yaml
total 4
drwxr-xr-x 2 puppet puppet 4096 Aug 11 15:48 node/
# ls -ld /var/lib/puppet/facts
drwxr-xr-x 2 puppet puppet 4096 Aug 11 15:32 /var/lib/puppet/facts/
#ls -l /var/lib/puppet/facts
total 0

On the puppet client:
# ls -l /var/lib/puppet/yaml
ls: /var/lib/puppet/yaml: No such file or directory
# ls -l /var/lib/puppet/facts
total 0

From what I can see, facts aren't being stored anywhere.

 Thanks,
 
 Nan

Thank you very much for all of your help so far.

Sincerely,

John Guthrie
jguth...@book.com

This electronic mail message contains information that (a) is or 
may be CONFIDENTIAL, PROPRIETARY IN NATURE, OR OTHERWISE 
PROTECTED 
BY LAW FROM DISCLOSURE, and (b) is intended only for the use of 
the addressee(s) named herein.  If you are not an intended 
recipient, please contact the sender immediately and take the 
steps necessary to delete the message completely from your 
computer system.

Not Intended as a Substitute for a Writing: Notwithstanding the 
Uniform Electronic Transaction Act or any other law of similar 
effect, absent an express statement to the contrary, this e-mail 
message, its contents, and any attachments hereto are not 
intended 
to represent an offer or acceptance to enter into a contract and 
are not otherwise intended to bind this sender, 
barnesandnoble.com 
llc, barnesandnoble.com inc. or any other person or entity.

-- 
You received this message because you are subscribed to 

Re: [Puppet Users] Vanishing facts

2011-08-12 Thread John T. Guthrie
Thanks for the quick response.

That was something more out of desperation.  I saw something on the page
with regarding the inventory service that facts_terminus would cause it
to get facts from a yaml repository.  I am having the same issue
regardless of whether I use facts_terminus = yaml or the default of
facts_terminus = facter.

Thanks very much.

John Guthrie
jguth...@book.com

On Thu, 2011-08-11 at 23:48 +0100, Ken Barber wrote: 
 Is your config facts_terminus=yaml for a reason? Usually its 'facter'.
 
 ken.
 
 On Thu, Aug 11, 2011 at 10:59 PM, John T. Guthrie jguth...@book.com wrote:
  Hello all,
 
  I am running puppet 2.7.1 with mongrel and an apache proxy.  I have been
  seeing an issue where it appears that the puppetmaster is completely
  ignoring any facts that are sent to it.
 
  When a client connects, any configuration that relies on facts shows
  those variables as being empty strings.  (I have been testing this with
  a simple notify resource that prints out the IP address and the FQDN.
  Both of these are coming up as empty strings.)  If I check the list of
  facts for a node through the REST API, it comes up as an empty list.
  Moreover, /var/lib/puppet/facts is persistently empty.  This has been
  happening with every client that I have checked.
 
  If run a packet capture on the puppetmaster paying attention to the
  puppetmaster ports, then I definitely see the puppetmaster receive the
  facts in b64_zlib_yaml format.  I can even decode the facts string and
  get the correct set of facts.  So the puppetmaster is definitely
  receiving the facts.  However, in the same packet capture, I see the
  puppetmaster return json for resources as if it had not received any
  facts at all.
 
  I have even gone so far as to blow away my entire /var/lib/puppet
  directory (except for the ssl), and try starting fresh to no avail.
 
  Does anyone have any suggestions for how I can fix this?  I am attaching
  my puppet.conf in case that will help.  Thanks in advance for any advice
  that anyone has.
 
  Thank you very much.
 
  John Guthrie
  jguth...@book.com
 
 



This electronic mail message contains information that (a) is or 
may be CONFIDENTIAL, PROPRIETARY IN NATURE, OR OTHERWISE 
PROTECTED 
BY LAW FROM DISCLOSURE, and (b) is intended only for the use of 
the addressee(s) named herein.  If you are not an intended 
recipient, please contact the sender immediately and take the 
steps necessary to delete the message completely from your 
computer system.

Not Intended as a Substitute for a Writing: Notwithstanding the 
Uniform Electronic Transaction Act or any other law of similar 
effect, absent an express statement to the contrary, this e-mail 
message, its contents, and any attachments hereto are not 
intended 
to represent an offer or acceptance to enter into a contract and 
are not otherwise intended to bind this sender, 
barnesandnoble.com 
llc, barnesandnoble.com inc. or any other person or entity.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: unable to distribute custom facts

2011-08-12 Thread newguy
well i decided to change the route a little, I have decided to make
a .rb file for adding fact rather then the environment variable and
heres what am doing and still getting the same error:

1.  On the puppetmaster in your modules directory create a facts
module with
subdirectory files. In this add any of your custom .rb scripts

# ls /etc/puppet/modules/facts/files
day_of_week.rb
hardware_platform.rb# = wiki example

2. On the puppetmaster in /etc/puppet/puppet.conf I added:-
pluginsync = true
factpath = $vardir/facts#vardir = /var/lib/puppet

3. On the puppetmaster in /etc/puppet/fileserver.conf I added:-
[facts]
path /var/lib/puppet/facts

4. On the server I added the file  /etc/profile.d/facter.sh
containing
export FACTERLIB=/var/lib/puppet/facts

after this again when I connect the client to puppet server I get the
following error:

err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
resource: Could not retrieve information from source(s) puppet://puppet/plugins

Help guys!!!


On Aug 12, 8:32 am, newguy aimanparv...@gmail.com wrote:
 Yes fact exists as a environment variable only
 Any suggestions anyone???
 On Aug 12, 7:50 am, Guy Matz gm...@matz.org wrote:







  Oh, wait . . .  that fact exists solely as an environment variable?  You
  haven't put that code in a file for distribution?  Then please ignore my
  previous response.  Sorry

  On Fri, Aug 12, 2011 at 10:30 AM, newguy aimanparv...@gmail.com wrote:
   Guys
   I made a custom fact using export;(export FACTER_envt=`hostname -s|cut
   -c 1-2`;) on puppet master, and when I do facter envt it shows the
   desired result, now my problem is that am unable to distribute it to
   the client machines.

   I read up a little on adding custom facts and found out the pluginsyc
   would help me but it didnt, I have pluginsync=true on both
   puppetmaster and client but still when I do sudo puppetd --test --
   pluginsync on client it says the following:

   err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
   resource: Could not retrieve information from source(s)
   puppet://puppet/plugins

   On client /var/lib/puppet/lib has no directory
   On server /var/lib/puppet/lib has puppet and facter directories

   sudo puppetd --configprint factpath on client is  /var/lib/puppet/lib/
   facter and on server its the same.

   Please help.

   Thanks

   --
   You received this message because you are subscribed to the Google Groups
   Puppet Users group.
   To post to this group, send email to puppet-users@googlegroups.com.
   To unsubscribe from this group, send email to
   puppet-users+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: need help with using tamplate function in Ruby DSL

2011-08-12 Thread piavlo

 Hi Craig,

You suggestions are correct for Puppet DSL but this code is a Ruby DSL
http://projects.puppetlabs.com/projects/1/wiki/Ruby_Dsl

On Aug 12, 9:16 pm, Craig White craig.wh...@ttiltd.com wrote:
 template should be a string, not an array

 content = template('nagios/ssa_nagios_contact.erb) # assuming it's in 
 modules/nagios/templates

 also, I think your 'require' should probably look like

 require = File[#{nagios_confdir}/app_alerts/ssa/contacts],

 but maybe your way will work

 Craig

 On Aug 12, 2011, at 11:06 AM, piavlo wrote:











  HI,

  I'm trying to use tamplate function in ruby dsl but I miserably fail.
  Then I just invoke it without using it in any resource like this

  template ['nagios/conf.d/app_alerts/ssa_nagios_contact.erb'],

  it works and i see

  
  debug: Scope(Class[Nagios::Ssa_nagios_contacts]): Retrieving template
  nagios/conf.d/app_alerts/ssa_nagios_contact.erb
  debug: template[/etc/puppet/modules/nagios/templates/conf.d/app_alerts/
  ssa_nagios_contact.erb]: Bound template variables for /etc/puppet/
  modules/nagios/templates/conf.d/app_alerts/ssa_nagios_contact.erb in
  0.00
  seconds
  debug: template[/etc/puppet/modules/nagios/templates/conf.d/app_alerts/
  ssa_nagios_contact.erb]: Interpolated template /etc/puppet/modules/
  nagios/templates/conf.d/app_alerts/ssa_nagios_contact.erb in 0.00
  seconds
  ...

  But obviously i need to use it inside resource - which does not work

  file( #{nagios_confdir}/app_alerts/ssa/contacts/#{x['doc']
  ['_id']}.cfg,
       :content = template ['nagios/conf.d/app_alerts/
  ssa_nagios_contact.erb'],
       :ensure  = :file,
       :owner   = 'root',
       :group   = 'root',
       :mode    = 0755,
       :require = File[#{nagios_confdir}/app_alerts/ssa/contacts] )

   end

  this fails with:

  debug: importing '/etc/puppet/modules/nagios/manifests/
  ssa_nagios_contacts.rb' in environment production
  err: (eval):53:in `parse_ruby_file': compile error
  (eval):42: syntax error, unexpected tLBRACK, expecting kDO or '{' or
  '('
       :content = template ['nagios/conf.d/app_alerts/
  ssa_...

  ^
  (eval):42: syntax error, unexpected ',', expecting
  kEND
  (eval):44: syntax error, unexpected ',', expecting
  kEND
  (eval):45: syntax error, unexpected ',', expecting
  kEND
  (eval):47: syntax error, unexpected ')', expecting
  kEND
  (eval):53: syntax error, unexpected $end, expecting kEND

  Please help.

  Thanks
  Alex

  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/puppet-users?hl=en.

 --
 Craig White ~~  craig.wh...@ttiltd.com
 1.800.869.6908 ~~~www.ttiassessments.com

 Need help communicating between generations at work to achieve your desired 
 success? Let us help!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: fighting packaging

2011-08-12 Thread piavlo
Does

  env DEBIAN_FRONTEND=noninteractive aptitude install -o
'APT::Get::force-yes=true'--assume-yes libapache2-mod-mono mono-apache-
server libmono-firebirdsql1.7-cil

still prompts you?

If not then it should work in puppet too.


On Aug 12, 7:53 pm, Craig White craig.wh...@ttiltd.com wrote:
 Clearly not a problem caused by puppet but something I can't apparently 
 deploy with puppet unless someone has an idea.

 Trying to automate a way to deploy mod_mono for apache

 from CLI, the problem seems obvious...

 apt-get install -y --assume-yes libapache2-mod-mono mono-apache-server 
 libmono-firebirdsql1.7-cil

 a massive pile of packages installs and it finally arrives at the truth 
 moment:

 Configuration file `/etc/apache2/mods-available/mod_mono.conf'
  == File on system created by you or by a script.
  == File also in package provided by package maintainer.
    What would you like to do about it ?  Your options are:
     Y or I  : install the package maintainer's version
     N or O  : keep your currently-installed version
       D     : show the differences between the versions
       Z     : background this process to examine the situation
  The default action is to keep your current version.
 *** mod_mono.conf (Y/I/N/O/D/Z) [default=N] ?

 So it appears that the same target, mod_mono.conf is being created both by 
 script and a file in the package itself and it appears that all of the '-y' 
 or '--assume-yes' logic in the command itself will not allow an install to 
 progress without an interactive answer to the question - the answer to which 
 is essentially meaningless because I can control the file anyway with puppet.

 Anyone have an idea how to defeat well intentioned but defective packager 
 logic?

 --
 Craig White ~~  craig.wh...@ttiltd.com
 1.800.869.6908 ~~~www.ttiassessments.com

 Need help communicating between generations at work to achieve your desired 
 success? Let us help!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: fighting packaging

2011-08-12 Thread piavlo
 Daniel,

 Is it safe to use force yes in debian package provider or is it
better to just fail?
So afaiu debian provider uses apt-get and not aptitude?


On Aug 12, 9:22 pm, Daniel Pittman dan...@puppetlabs.com wrote:
 You should file a bug report against the package with Debian; we set
 the noninteractive, and the force yes, bits that absolutely
 *should* make it work fine in these circumstances.

 I am sorry that it doesn't work; if you find something we didn't do,
 that makes the prompt go away, please let us know. :)

 Daniel









 On Fri, Aug 12, 2011 at 13:38, Craig White craig.wh...@ttiltd.com wrote:
  Appear that 'adminfile' option is a Solaris only thing.

  I found that ubuntu/debian has 
  debconf-get-selections/debconf-set-selections packages which might actually 
  get me there but it introduces new package dependencies and would take more 
  time than it is reasonably worth as we will never have many servers with 
  mod-mono anyway.

  I think I will just manually install on the servers that will need it.

  Thanks

  Craig

  On Aug 12, 2011, at 9:56 AM, Nathan Clemons wrote:

  Isn't there an adminfile option to the package resource that will let you 
  pass responses as if it were an interactive session? Not sure if it's 
  supported for the apt provider, but worth looking into if you haven't 
  already.

  --
  Nathan Clemons
 http://www.livemocha.com
  The worlds largest online language learning community

  On Fri, Aug 12, 2011 at 9:53 AM, Craig White craig.wh...@ttiltd.com 
  wrote:
  Clearly not a problem caused by puppet but something I can't apparently 
  deploy with puppet unless someone has an idea.

  Trying to automate a way to deploy mod_mono for apache

  from CLI, the problem seems obvious...

  apt-get install -y --assume-yes libapache2-mod-mono mono-apache-server 
  libmono-firebirdsql1.7-cil

  a massive pile of packages installs and it finally arrives at the truth 
  moment:

  Configuration file `/etc/apache2/mods-available/mod_mono.conf'
   == File on system created by you or by a script.
   == File also in package provided by package maintainer.
    What would you like to do about it ?  Your options are:
     Y or I  : install the package maintainer's version
     N or O  : keep your currently-installed version
       D     : show the differences between the versions
       Z     : background this process to examine the situation
   The default action is to keep your current version.
  *** mod_mono.conf (Y/I/N/O/D/Z) [default=N] ?

  So it appears that the same target, mod_mono.conf is being created both by 
  script and a file in the package itself and it appears that all of the 
  '-y' or '--assume-yes' logic in the command itself will not allow an 
  install to progress without an interactive answer to the question - the 
  answer to which is essentially meaningless because I can control the file 
  anyway with puppet.

  Anyone have an idea how to defeat well intentioned but defective packager 
  logic?

  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/puppet-users?hl=en.

 --
 ⎋ Puppet Labs Developer –http://puppetlabs.com
 ♲ Made with 100 percent post-consumer electrons

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: fighting packaging

2011-08-12 Thread Craig White

On Aug 12, 2011, at 12:14 PM, piavlo wrote:

  env DEBIAN_FRONTEND=noninteractive aptitude install -o
 'APT::Get::force-yes=true'--assume-yes libapache2-mod-mono mono-apache-
 server libmono-firebirdsql1.7-cil


don't even get out of the box...

Need to get 0B/55.7MB of archives. After unpacking 186MB will be used.
Do you want to continue? [Y/n/?] n
Abort.

adding a '-y' into the mix got me to the very same gore point - issue is simply 
the packager trying to do users a favor by including his suggested copy of the 
config file which contends with a file by the same name that is apparently 
created by a post-install script. 

Thanks for the idea though

Craig

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: fighting packaging

2011-08-12 Thread Daniel Pittman
Relatively speaking, it is safe.  Not perfect, but neither is the
other decision.

Generally speaking, 'force yes' shows up any time that folks modify a
configuration file as a critical option.  Without that, replacement
wouldn't happen the same way.

Daniel

On Fri, Aug 12, 2011 at 15:17, piavlo lolitus...@gmail.com wrote:
  Daniel,

  Is it safe to use force yes in debian package provider or is it
 better to just fail?
 So afaiu debian provider uses apt-get and not aptitude?


 On Aug 12, 9:22 pm, Daniel Pittman dan...@puppetlabs.com wrote:
 You should file a bug report against the package with Debian; we set
 the noninteractive, and the force yes, bits that absolutely
 *should* make it work fine in these circumstances.

 I am sorry that it doesn't work; if you find something we didn't do,
 that makes the prompt go away, please let us know. :)

 Daniel









 On Fri, Aug 12, 2011 at 13:38, Craig White craig.wh...@ttiltd.com wrote:
  Appear that 'adminfile' option is a Solaris only thing.

  I found that ubuntu/debian has 
  debconf-get-selections/debconf-set-selections packages which might 
  actually get me there but it introduces new package dependencies and would 
  take more time than it is reasonably worth as we will never have many 
  servers with mod-mono anyway.

  I think I will just manually install on the servers that will need it.

  Thanks

  Craig

  On Aug 12, 2011, at 9:56 AM, Nathan Clemons wrote:

  Isn't there an adminfile option to the package resource that will let you 
  pass responses as if it were an interactive session? Not sure if it's 
  supported for the apt provider, but worth looking into if you haven't 
  already.

  --
  Nathan Clemons
 http://www.livemocha.com
  The worlds largest online language learning community

  On Fri, Aug 12, 2011 at 9:53 AM, Craig White craig.wh...@ttiltd.com 
  wrote:
  Clearly not a problem caused by puppet but something I can't apparently 
  deploy with puppet unless someone has an idea.

  Trying to automate a way to deploy mod_mono for apache

  from CLI, the problem seems obvious...

  apt-get install -y --assume-yes libapache2-mod-mono mono-apache-server 
  libmono-firebirdsql1.7-cil

  a massive pile of packages installs and it finally arrives at the truth 
  moment:

  Configuration file `/etc/apache2/mods-available/mod_mono.conf'
   == File on system created by you or by a script.
   == File also in package provided by package maintainer.
    What would you like to do about it ?  Your options are:
     Y or I  : install the package maintainer's version
     N or O  : keep your currently-installed version
       D     : show the differences between the versions
       Z     : background this process to examine the situation
   The default action is to keep your current version.
  *** mod_mono.conf (Y/I/N/O/D/Z) [default=N] ?

  So it appears that the same target, mod_mono.conf is being created both 
  by script and a file in the package itself and it appears that all of the 
  '-y' or '--assume-yes' logic in the command itself will not allow an 
  install to progress without an interactive answer to the question - the 
  answer to which is essentially meaningless because I can control the file 
  anyway with puppet.

  Anyone have an idea how to defeat well intentioned but defective packager 
  logic?

  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/puppet-users?hl=en.

 --
 ⎋ Puppet Labs Developer –http://puppetlabs.com
 ♲ Made with 100 percent post-consumer electrons

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.





-- 
⎋ Puppet Labs Developer – http://puppetlabs.com
♲ Made with 100 percent post-consumer electrons

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Dashboard rhel5 problems

2011-08-12 Thread Marek Dohojda
Hello

I have a running puppet and passenger (2.6.8) running on RHEL5.  I installed
dashboard and configured it, and all that is working as well.  However I
don't want to run webrick I want to put dashboard under passenger with
apache.

I have done the conf change to add virtual host, and changed it to run under
port 3000 (as default).

Everything start correctly, but that's as far as I can get.  When I go to
the server port 3000 I get default apache web page (due to there not being
index.html nor any app running).  I followed another instructions which said
to add this for RHEL:

SetEnv RAILS_ENV production
   RackBaseURI /

This allowed me to get ruby error screen instead of default apache test
page.  However I go an error file not found config.ru.  I copied
config.ruto /usr/share/puppet-dashboard/ from (

/usr/share/puppet-dashboard/vendor/rails/railties/dispatches/config.ru)
which was only place I found config.ru within dashboard.
Now I am getting following:
 Exception NoMethodError in PhusionPassenger::Rack::ApplicationSpawner
(undefined method `requirement' for #Rails::GemDependency:0x2b325908)
(process 24074):

And at this point I am stuck.  I bet I am missing something probably simple
but I can't figure out what.

I am including my conf for passanger below:
PassengerHighPerformance on
PassengerMaxPoolSize 12
PassengerPoolIdleTime 1500
# PassengerMaxRequests 1000
PassengerStatThrottleRate 120
RailsAutoDetect On
Listen 3000
VirtualHost *:3000
ServerName servername
DocumentRoot /usr/share/puppet-dashboard/public/
SetEnv RAILS_ENV production
RackBaseURI /
Directory /usr/share/puppet-dashboard/public/
Options None
AllowOverride AuthConfig
Order allow,deny
allow from all
/Directory
  ErrorLog /var/log/httpd/dashboard_error.log
  LogLevel warn
  CustomLog /var/log/httpd/dashboard_access.log combined
  ServerSignature On
/VirtualHost

I hope someone can point me in the right direction.
Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: hasstatus not working as expected

2011-08-12 Thread Chad
 So puppet actually uses »/sbin/service build_iptables status« to check
 if your service is running.

Agreed.  The service command works as well (and it also checks to make
sure it is chkconfig'ed on)

This has worked for months before recently.  I just just checked and I
added the status option on 2/23/11 (these are in a version control
system, so I have logs).

I just attempted to find in the logs when this started happening
(suspect 2 weeks ago), but I had the loglevel set to debug on this
from an old test I was doing and never removed it (oops!).

Any other ideas?

On Aug 12, 1:39 pm, Stefan Schulte stefan.schu...@taunusstein.net
wrote:
 On Fri, Aug 12, 2011 at 06:32:57AM -0700, Chad wrote:
  All,

  I have puppet watching various services on RHEL systems and restarting
  them as necessary.

  Quite a while back I wrote some custom scripts as wrappers for various
  services so that I can have a custom running status.  These have
  worked for quite a few months, but recently my iptables services have
  been restarting every time puppet checks in.

  Problem:

  [me@host ~]$ sudo /usr/sbin/puppetd --test --noop
  info: Caching catalog for host@fakedomain
  info: Applying configuration version '1312979662'
  notice: //iptables/Service[build_iptables]/ensure: is stopped, should
  be running (noop)
  notice: Finished catalog run in 3.09 seconds

  Excerpt from manifest that does this:

      service { build_iptables:
         enable      = true,
         ensure      = running,
         hasstatus = true,
      }

  'build_iptables' does a couple of things, but most importantly for
  this problem it runs a regex to look for a particular rule to see if
  it exists.  If said rule exists it returns that the service is
  running, if that rule doesn't exist then it says it is not running and
  restarts the 'build_iptables' service (which does things to fix the
  issue along with restarts the real iptables service).

  But if I run the same build_iptables script I see that it is running:

  [me@host ~]$ sudo /sbin/service build_iptables status
  iptables is running
  [me@host ~]$ echo $?
  0

  [me@host ~]$ sudo /usr/sbin/puppetd --test --noop
  info: Caching catalog for host.fakedomain
  info: Applying configuration version '1312979662'
  notice: //iptables/Service[build_iptables]/ensure: is stopped, should
  be running (noop)
  notice: Finished catalog run in 2.88 seconds

  [me@host ~]$ sudo /sbin/service build_iptables status
  iptables is running
  [me@host ~]$ echo $?
  0

  This worked for a number of months, but recently broke.  The issue is
  that when iptables restarts it drops it's state table and any
  connections that would be allowed (through the ESTABLISHED or RELATED
  rule) are no longer recognized and the packets are dropped.

  Here is the relevant debug output:

  debug: Service[build_iptables](provider=redhat): Executing '/sbin/
  service build_iptables status'
  debug: Puppet::Type::Service::ProviderRedhat: Executing '/sbin/
  chkconfig build_iptables'
  debug: //iptables/Service[build_iptables]: Changing ensure
  debug: //iptables/Service[build_iptables]: 1 change(s)
  notice: //iptables/Service[build_iptables]/ensure: is stopped, should
  be running (noop)

 So puppet actually uses »/sbin/service build_iptables status« to check
 if your service is running.

 Is it possible that your initscript depends on a specific environment
 (like a special PATH variable?). Maybe your script doesnt work when run
 through puppet so it doesnt return with zero and puppet thinks the
 service is not running.

 -Stefan

  application_pgp-signature_part
  1KViewDownload

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Accessing node variable in class and using it in a conditionnal

2011-08-12 Thread piavlo
Does it work if you change to

if ( $::smcvhost == 'belleville' ) or ( $::smcvhost == 'all' ) {

?

Alex

On Aug 12, 2:34 pm, Antoine Benkemoun antoine.benkem...@gmail.com
wrote:
 Hello,

 First of all, thank you for making the awesome piece of software that is
 Puppet. I have working with it for a week and I'm really liking what I'm
 seeing and I have been able to do quite a few tasks with ease. Currently, I
 am trying to configure Apache Virtual Hosts with Puppet and have been trying
 different things with little success.

 I have defined a node as the following :

     node 'test1.cob' inherits serveurClient {
             $smcvhost = 'all'
     }

 The serveurClient class includes the apache class. This works fine as Apache
 gets installed and all the configuration gets applied correctly, except the
 virtual hosts.

 The configuration relating to the virtual hosts is the following :

     class apache::config {
         File{
             require = Class[apache::install],
             notify  = Class[apache::service],
              ensure  = present,
             owner   = www-data,
             group   = www-data,
             mode    = 755
         }
         ...
         if ( $smcvhost == 'belleville' ) or ( $smcvhost == 'all' ) {
             apache::smcvhost{'belleville':
                 client = 'belleville',
             }
         }
         ...
     }

 The *apache::smcvhost* definition works correctly because if I specify it
 directly in the node without the condition, the virtual host gets created
 correctly with no errors. If I remove the if statement, it will also get
 created correctly. I have tried only specifying the second condition but
 that did not make it work.

 When this fails to be executed, I do not get any error. The puppet report
 just ignores this configuration part.

 I am thinking that this is some sort of variable scoping problem but from
 what I have read, this practice seems correct and I imagine puppet would
 give me some error if I tried to evaluate a non-existing variable.

 Thank you in advance for your help,

 Antoine

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Accessing node variable in class and using it in a conditionnal

2011-08-12 Thread Scott Smith
I experienced something similar to this. Try it without quoting the RHS. E.g

if $smcvhost = belleville {
}

Also, what you are doing is code smell.

On Fri, Aug 12, 2011 at 4:34 AM, Antoine Benkemoun 
antoine.benkem...@gmail.com wrote:

 Hello,

 First of all, thank you for making the awesome piece of software that is
 Puppet. I have working with it for a week and I'm really liking what I'm
 seeing and I have been able to do quite a few tasks with ease. Currently, I
 am trying to configure Apache Virtual Hosts with Puppet and have been trying
 different things with little success.

 I have defined a node as the following :

 node 'test1.cob' inherits serveurClient {
 $smcvhost = 'all'
 }

 The serveurClient class includes the apache class. This works fine as
 Apache gets installed and all the configuration gets applied correctly,
 except the virtual hosts.

 The configuration relating to the virtual hosts is the following :

 class apache::config {
 File{
 require = Class[apache::install],
 notify  = Class[apache::service],
  ensure  = present,
 owner   = www-data,
 group   = www-data,
 mode= 755
 }
 ...
 if ( $smcvhost == 'belleville' ) or ( $smcvhost == 'all' ) {
 apache::smcvhost{'belleville':
 client = 'belleville',
 }
 }
 ...
 }

 The *apache::smcvhost* definition works correctly because if I specify it
 directly in the node without the condition, the virtual host gets created
 correctly with no errors. If I remove the if statement, it will also get
 created correctly. I have tried only specifying the second condition but
 that did not make it work.

 When this fails to be executed, I do not get any error. The puppet report
 just ignores this configuration part.

 I am thinking that this is some sort of variable scoping problem but from
 what I have read, this practice seems correct and I imagine puppet would
 give me some error if I tried to evaluate a non-existing variable.

 Thank you in advance for your help,

 Antoine

  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Dashboard rhel5 problems

2011-08-12 Thread Craig White

On Aug 12, 2011, at 1:13 PM, Marek Dohojda wrote:

 Hello
 
 I have a running puppet and passenger (2.6.8) running on RHEL5.  I installed 
 dashboard and configured it, and all that is working as well.  However I 
 don't want to run webrick I want to put dashboard under passenger with apache.
 
 I have done the conf change to add virtual host, and changed it to run under 
 port 3000 (as default).
 
 Everything start correctly, but that's as far as I can get.  When I go to the 
 server port 3000 I get default apache web page (due to there not being 
 index.html nor any app running).  I followed another instructions which said 
 to add this for RHEL:
 
 SetEnv RAILS_ENV production
RackBaseURI /
 
 This allowed me to get ruby error screen instead of default apache test page. 
  However I go an error file not found config.ru.  I copied config.ru to 
 /usr/share/puppet-dashboard/ from (   
 /usr/share/puppet-dashboard/vendor/rails/railties/dispatches/config.ru) which 
 was only place I found config.ru within dashboard.  
 Now I am getting following:
  Exception NoMethodError in PhusionPassenger::Rack::ApplicationSpawner 
 (undefined method `requirement' for #Rails::GemDependency:0x2b325908) 
 (process 24074):
 
 And at this point I am stuck.  I bet I am missing something probably simple 
 but I can't figure out what.
 
 I am including my conf for passanger below:
 PassengerHighPerformance on
 PassengerMaxPoolSize 12
 PassengerPoolIdleTime 1500
 # PassengerMaxRequests 1000
 PassengerStatThrottleRate 120
 RailsAutoDetect On

I've got the above lines inside my VirtualHost  declaration

I also have
PassengerUseGlobalQueue on

 Listen 3000
 VirtualHost *:3000
 ServerName servername
 DocumentRoot /usr/share/puppet-dashboard/public/
 SetEnv RAILS_ENV production
 RackBaseURI /
 Directory /usr/share/puppet-dashboard/public/
 Options None
 AllowOverride AuthConfig
 Order allow,deny
 allow from all

I have 
Options -Multiviews
here inside the Directory  declaration

 /Directory
   ErrorLog /var/log/httpd/dashboard_error.log
   LogLevel warn
   CustomLog /var/log/httpd/dashboard_access.log combined
   ServerSignature On
 /VirtualHost
 
 I hope someone can point me in the right direction.
 Thank you!

not sure but this may help

Craig

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: hasstatus not working as expected

2011-08-12 Thread Tim Mooney

In regard to: [Puppet Users] Re: hasstatus not working as expected, Chad...:


status)
 /sbin/iptables -L | /bin/egrep '^DROP+\s+all.*NEW\s?+$'  /dev/
null


I doubt this is the actual problem, but you could more portably and
more correctly write that regex as

'^DROP[[:space:]]+all.*NEW[[:space:]]*$'

You don't need the + after the P, since you don't want to match things
like DROP, and you don't need the ? or the + after NEW, since you're
anchoring the end and there's therefore really no reason to use non-greedy
matching.  Your comment also mentions any amount of whitespace, which
presumably includes 0 matches, hence the * instead of the +.

Also, you should probably run (as you)

env grep -i grep

and see if something like GREP_OPTIONS is in your environment.


# A string has to start with DROP then whitespace, then all, then
anything, then NEW, then any amount of whitespace
# For some reason iptables -L has a whitespace after NEW
 if [ $? = 0 ]; then
echo iptables is running
exit 0
 else
echo iptables is stopped
exit 3
 fi
 ;;
**


Tim
--
Tim Mooney  moo...@dogbert.cc.ndsu.nodak.edu
Enterprise Computing  Infrastructure   701-231-1076 (Voice)
Room 242-J6, IACC Building  701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: unable to distribute custom facts

2011-08-12 Thread Aaron Grewell
IIRC you're doing this the hard way.  The easy way:
1) Create a module:
mkdir -p /etc/puppet/modules/facts

2) Create the pluginsync directories in your module
mkdir -p /etc/puppet/modules/facts/lib/facter

3) Put custom facts in the directory you just made

4) Enable pluginsync on master  clients

That should be it, unless I've forgotten something (which would never happen
of course)  ;)

# ls /etc/puppet/modules/facts/

 files
 day_of_week.rb
 hardware_platform.rb# = wiki example



On Fri, Aug 12, 2011 at 11:42 AM, newguy aimanparv...@gmail.com wrote:

 well i decided to change the route a little, I have decided to make
 a .rb file for adding fact rather then the environment variable and
 heres what am doing and still getting the same error:

 1.  On the puppetmaster in your modules directory create a facts
 module with
 subdirectory files. In this add any of your custom .rb scripts

 # ls /etc/puppet/modules/facts/files
 day_of_week.rb
 hardware_platform.rb# = wiki example

 2. On the puppetmaster in /etc/puppet/puppet.conf I added:-
pluginsync = true
factpath = $vardir/facts#vardir = /var/lib/puppet

 3. On the puppetmaster in /etc/puppet/fileserver.conf I added:-
 [facts]
 path /var/lib/puppet/facts

 4. On the server I added the file  /etc/profile.d/facter.sh
 containing
 export FACTERLIB=/var/lib/puppet/facts

 after this again when I connect the client to puppet server I get the
 following error:

 err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
 resource: Could not retrieve information from source(s)
 puppet://puppet/plugins

 Help guys!!!


 On Aug 12, 8:32 am, newguy aimanparv...@gmail.com wrote:
  Yes fact exists as a environment variable only
  Any suggestions anyone???
  On Aug 12, 7:50 am, Guy Matz gm...@matz.org wrote:
 
 
 
 
 
 
 
   Oh, wait . . .  that fact exists solely as an environment variable?
  You
   haven't put that code in a file for distribution?  Then please ignore
 my
   previous response.  Sorry
 
   On Fri, Aug 12, 2011 at 10:30 AM, newguy aimanparv...@gmail.com
 wrote:
Guys
I made a custom fact using export;(export FACTER_envt=`hostname
 -s|cut
-c 1-2`;) on puppet master, and when I do facter envt it shows the
desired result, now my problem is that am unable to distribute it to
the client machines.
 
I read up a little on adding custom facts and found out the pluginsyc
would help me but it didnt, I have pluginsync=true on both
puppetmaster and client but still when I do sudo puppetd --test --
pluginsync on client it says the following:
 
err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
resource: Could not retrieve information from source(s)
puppet://puppet/plugins
 
On client /var/lib/puppet/lib has no directory
On server /var/lib/puppet/lib has puppet and facter directories
 
sudo puppetd --configprint factpath on client is
  /var/lib/puppet/lib/
facter and on server its the same.
 
Please help.
 
Thanks
 
--
You received this message because you are subscribed to the Google
 Groups
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
   http://groups.google.com/group/puppet-users?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: unable to distribute custom facts

2011-08-12 Thread Aaron Grewell
Oh, and include module 'facts' on every node where these facts will be
used.  That could be somewhat important.

On Fri, Aug 12, 2011 at 2:15 PM, Aaron Grewell aaron.grew...@gmail.comwrote:

 IIRC you're doing this the hard way.  The easy way:
 1) Create a module:
 mkdir -p /etc/puppet/modules/facts

 2) Create the pluginsync directories in your module
 mkdir -p /etc/puppet/modules/facts/lib/facter

 3) Put custom facts in the directory you just made

 4) Enable pluginsync on master  clients

 That should be it, unless I've forgotten something (which would never
 happen of course)  ;)


 # ls /etc/puppet/modules/facts/

 files
 day_of_week.rb
 hardware_platform.rb# = wiki example



 On Fri, Aug 12, 2011 at 11:42 AM, newguy aimanparv...@gmail.com wrote:

 well i decided to change the route a little, I have decided to make
 a .rb file for adding fact rather then the environment variable and
 heres what am doing and still getting the same error:

 1.  On the puppetmaster in your modules directory create a facts
 module with
 subdirectory files. In this add any of your custom .rb scripts

 # ls /etc/puppet/modules/facts/files
 day_of_week.rb
 hardware_platform.rb# = wiki example

 2. On the puppetmaster in /etc/puppet/puppet.conf I added:-
pluginsync = true
factpath = $vardir/facts#vardir = /var/lib/puppet

 3. On the puppetmaster in /etc/puppet/fileserver.conf I added:-
 [facts]
 path /var/lib/puppet/facts

 4. On the server I added the file  /etc/profile.d/facter.sh
 containing
 export FACTERLIB=/var/lib/puppet/facts

 after this again when I connect the client to puppet server I get the
 following error:

 err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
 resource: Could not retrieve information from source(s)
 puppet://puppet/plugins

 Help guys!!!


 On Aug 12, 8:32 am, newguy aimanparv...@gmail.com wrote:
  Yes fact exists as a environment variable only
  Any suggestions anyone???
  On Aug 12, 7:50 am, Guy Matz gm...@matz.org wrote:
 
 
 
 
 
 
 
   Oh, wait . . .  that fact exists solely as an environment variable?
  You
   haven't put that code in a file for distribution?  Then please ignore
 my
   previous response.  Sorry
 
   On Fri, Aug 12, 2011 at 10:30 AM, newguy aimanparv...@gmail.com
 wrote:
Guys
I made a custom fact using export;(export FACTER_envt=`hostname
 -s|cut
-c 1-2`;) on puppet master, and when I do facter envt it shows the
desired result, now my problem is that am unable to distribute it to
the client machines.
 
I read up a little on adding custom facts and found out the
 pluginsyc
would help me but it didnt, I have pluginsync=true on both
puppetmaster and client but still when I do sudo puppetd --test --
pluginsync on client it says the following:
 
err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
resource: Could not retrieve information from source(s)
puppet://puppet/plugins
 
On client /var/lib/puppet/lib has no directory
On server /var/lib/puppet/lib has puppet and facter directories
 
sudo puppetd --configprint factpath on client is
  /var/lib/puppet/lib/
facter and on server its the same.
 
Please help.
 
Thanks
 
--
You received this message because you are subscribed to the Google
 Groups
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
   http://groups.google.com/group/puppet-users?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] enviroments are not being used

2011-08-12 Thread Frederiko Costa
Hello everyone,

I have the following environments configured as master:

# puppetmasterd -V
0.25.4

# cat puppet.conf
[main]
 confir=/etc/puppet
 logdir=/var/log/puppet
 vardir=/var/lib/puppet
 ssldir=/var/lib/puppet/ssl
 rundir=/var/run/puppet
 pidfile=$rundir/puppetmasterd.pid
 factpath=$vardir/lib/facter
 pluginsync=true
 templatedir=$confdir/templates
 prerun_command=/etc/puppet/etckeeper-commit-pre
 postrun_command=/etc/puppet/etckeeper-commit-post

[master] 
  modulepath=$confdir/environments/$environment/modules:$confdir/modules
  manifest=$confdir/manifests/unknown.pp

[development]
 manifest   = $confdir/manifests/site.pp

[testing]
 manifest   = $confdir/manifests/site.pp

I have the modules in place, for every environment. This does not seem to be 
an issue. Certificates are correctly signed.
The problem is that my agent located on another host, does not load the 
development environment whenever I run the following command:
# puppetd -V
0.25.4

# puppetd agent --verbose --server=lbre-puppet.stanford.edu --noop --test 
--environment development

I get the following in the agent when I run the command above:

info: Caching catalog for ganglia01.stanford.edu
info: Applying configuration version '1313184594'
notice: //gangliamonitor::service/Service[ganglia-monitor]/ensure: is 
stopped, should be running 
(noop)   
notice: Finished catalog run in 0.11 seconds

It runs fine, but not the development environment. I even mess it up the 
development module to make sure it was running something different. It runs 
the main one. The master's output is the regular output as if I had ran 
without the --environment switch.

Does anyone know what could be missing or causing this behavior?

I appreciate in advance.

-Fred

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/J8KCeY1wnjwJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: enviroments are not being used

2011-08-12 Thread newguy
give the module path in development
[development]
modulepath = /etc/puppet/environments/development/modules


Thanks

On Aug 12, 2:39 pm, Frederiko Costa freder...@gmail.com wrote:
 Hello everyone,

 I have the following environments configured as master:

 # puppetmasterd -V
 0.25.4

 # cat puppet.conf
 [main]
  confir=/etc/puppet
  logdir=/var/log/puppet
  vardir=/var/lib/puppet
  ssldir=/var/lib/puppet/ssl
  rundir=/var/run/puppet
  pidfile=$rundir/puppetmasterd.pid
  factpath=$vardir/lib/facter
  pluginsync=true
  templatedir=$confdir/templates
  prerun_command=/etc/puppet/etckeeper-commit-pre
  postrun_command=/etc/puppet/etckeeper-commit-post

 [master]
   modulepath=$confdir/environments/$environment/modules:$confdir/modules
   manifest=$confdir/manifests/unknown.pp

 [development]
  manifest   = $confdir/manifests/site.pp

 [testing]
  manifest   = $confdir/manifests/site.pp

 I have the modules in place, for every environment. This does not seem to be
 an issue. Certificates are correctly signed.
 The problem is that my agent located on another host, does not load the
 development environment whenever I run the following command:
 # puppetd -V
 0.25.4

 # puppetd agent --verbose --server=lbre-puppet.stanford.edu --noop --test
 --environment development

 I get the following in the agent when I run the command above:

 info: Caching catalog for ganglia01.stanford.edu
 info: Applying configuration version '1313184594'
 notice: //gangliamonitor::service/Service[ganglia-monitor]/ensure: is
 stopped, should be running
 (noop)                                              
 notice: Finished catalog run in 0.11 seconds

 It runs fine, but not the development environment. I even mess it up the
 development module to make sure it was running something different. It runs
 the main one. The master's output is the regular output as if I had ran
 without the --environment switch.

 Does anyone know what could be missing or causing this behavior?

 I appreciate in advance.

 -Fred

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: enviroments are not being used

2011-08-12 Thread newguy
in continuation.
and put/copy your modules in the path, that should do the trick.

On Aug 12, 3:14 pm, newguy aimanparv...@gmail.com wrote:
 give the module path in development
 [development]
 modulepath = /etc/puppet/environments/development/modules

 Thanks

 On Aug 12, 2:39 pm, Frederiko Costa freder...@gmail.com wrote:







  Hello everyone,

  I have the following environments configured as master:

  # puppetmasterd -V
  0.25.4

  # cat puppet.conf
  [main]
   confir=/etc/puppet
   logdir=/var/log/puppet
   vardir=/var/lib/puppet
   ssldir=/var/lib/puppet/ssl
   rundir=/var/run/puppet
   pidfile=$rundir/puppetmasterd.pid
   factpath=$vardir/lib/facter
   pluginsync=true
   templatedir=$confdir/templates
   prerun_command=/etc/puppet/etckeeper-commit-pre
   postrun_command=/etc/puppet/etckeeper-commit-post

  [master]
    modulepath=$confdir/environments/$environment/modules:$confdir/modules
    manifest=$confdir/manifests/unknown.pp

  [development]
   manifest   = $confdir/manifests/site.pp

  [testing]
   manifest   = $confdir/manifests/site.pp

  I have the modules in place, for every environment. This does not seem to be
  an issue. Certificates are correctly signed.
  The problem is that my agent located on another host, does not load the
  development environment whenever I run the following command:
  # puppetd -V
  0.25.4

  # puppetd agent --verbose --server=lbre-puppet.stanford.edu --noop --test
  --environment development

  I get the following in the agent when I run the command above:

  info: Caching catalog for ganglia01.stanford.edu
  info: Applying configuration version '1313184594'
  notice: //gangliamonitor::service/Service[ganglia-monitor]/ensure: is
  stopped, should be running
  (noop)                                              
  notice: Finished catalog run in 0.11 seconds

  It runs fine, but not the development environment. I even mess it up the
  development module to make sure it was running something different. It runs
  the main one. The master's output is the regular output as if I had ran
  without the --environment switch.

  Does anyone know what could be missing or causing this behavior?

  I appreciate in advance.

  -Fred

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: unable to distribute custom facts

2011-08-12 Thread newguy
well my thing worked(partly) I just had to put the fact (envt.rb) in /
etc/puppet/modules/facts/lib/facter/files. I can see the fact when I
did facter -p on client but the problem is this fact is not available
on the puppet master. I executed this simple code(a test module) to
reach this conclusion, please help

class test_mod {
if $envt=='ip'{
file {/home/ubuntu/a:
ensure=file
}
}
else {
file {/home/ubuntu/ai:
ensure=file
}
}

file ai was made .

Please help


On Aug 12, 2:17 pm, Aaron Grewell aaron.grew...@gmail.com wrote:
 Oh, and include module 'facts' on every node where these facts will be
 used.  That could be somewhat important.

 On Fri, Aug 12, 2011 at 2:15 PM, Aaron Grewell aaron.grew...@gmail.comwrote:







  IIRC you're doing this the hard way.  The easy way:
  1) Create a module:
  mkdir -p /etc/puppet/modules/facts

  2) Create the pluginsync directories in your module
  mkdir -p /etc/puppet/modules/facts/lib/facter

  3) Put custom facts in the directory you just made

  4) Enable pluginsync on master  clients

  That should be it, unless I've forgotten something (which would never
  happen of course)  ;)

  # ls /etc/puppet/modules/facts/

  files
  day_of_week.rb
  hardware_platform.rb    # = wiki example

  On Fri, Aug 12, 2011 at 11:42 AM, newguy aimanparv...@gmail.com wrote:

  well i decided to change the route a little, I have decided to make
  a .rb file for adding fact rather then the environment variable and
  heres what am doing and still getting the same error:

  1.  On the puppetmaster in your modules directory create a facts
  module with
  subdirectory files. In this add any of your custom .rb scripts

  # ls /etc/puppet/modules/facts/files
  day_of_week.rb
  hardware_platform.rb    # = wiki example

  2. On the puppetmaster in /etc/puppet/puppet.conf I added:-
     pluginsync = true
     factpath = $vardir/facts    #vardir = /var/lib/puppet

  3. On the puppetmaster in /etc/puppet/fileserver.conf I added:-
  [facts]
  path /var/lib/puppet/facts

  4. On the server I added the file  /etc/profile.d/facter.sh
  containing
  export FACTERLIB=/var/lib/puppet/facts

  after this again when I connect the client to puppet server I get the
  following error:

  err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
  resource: Could not retrieve information from source(s)
  puppet://puppet/plugins

  Help guys!!!

  On Aug 12, 8:32 am, newguy aimanparv...@gmail.com wrote:
   Yes fact exists as a environment variable only
   Any suggestions anyone???
   On Aug 12, 7:50 am, Guy Matz gm...@matz.org wrote:

Oh, wait . . .  that fact exists solely as an environment variable?
   You
haven't put that code in a file for distribution?  Then please ignore
  my
previous response.  Sorry

On Fri, Aug 12, 2011 at 10:30 AM, newguy aimanparv...@gmail.com
  wrote:
 Guys
 I made a custom fact using export;(export FACTER_envt=`hostname
  -s|cut
 -c 1-2`;) on puppet master, and when I do facter envt it shows the
 desired result, now my problem is that am unable to distribute it to
 the client machines.

 I read up a little on adding custom facts and found out the
  pluginsyc
 would help me but it didnt, I have pluginsync=true on both
 puppetmaster and client but still when I do sudo puppetd --test --
 pluginsync on client it says the following:

 err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
 resource: Could not retrieve information from source(s)
 puppet://puppet/plugins

 On client /var/lib/puppet/lib has no directory
 On server /var/lib/puppet/lib has puppet and facter directories

 sudo puppetd --configprint factpath on client is
   /var/lib/puppet/lib/
 facter and on server its the same.

 Please help.

 Thanks

 --
 You received this message because you are subscribed to the Google
  Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.

  --
  You received this message because you are subscribed to the Google Groups
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: unable to distribute custom facts

2011-08-12 Thread newguy
Guys it worked , my custom fact file was in
/etc/puppet/modules/module/facts/lib/facter/files I just changed it to

/etc/puppet/modules/facts/lib/facter/files and it worked

Thanks for all ur help.

On Aug 12, 3:20 pm, newguy aimanparv...@gmail.com wrote:
 well my thing worked(partly) I just had to put the fact (envt.rb) in /
 etc/puppet/modules/facts/lib/facter/files. I can see the fact when I
 did facter -p on client but the problem is this fact is not available
 on the puppet master. I executed this simple code(a test module) to
 reach this conclusion, please help

 class test_mod {
 if $envt=='ip'{
 file {/home/ubuntu/a:
         ensure=file}
 }

 else {
 file {/home/ubuntu/ai:
         ensure=file

 }
 }

 file ai was made .

 Please help

 On Aug 12, 2:17 pm, Aaron Grewell aaron.grew...@gmail.com wrote:







  Oh, and include module 'facts' on every node where these facts will be
  used.  That could be somewhat important.

  On Fri, Aug 12, 2011 at 2:15 PM, Aaron Grewell 
  aaron.grew...@gmail.comwrote:

   IIRC you're doing this the hard way.  The easy way:
   1) Create a module:
   mkdir -p /etc/puppet/modules/facts

   2) Create the pluginsync directories in your module
   mkdir -p /etc/puppet/modules/facts/lib/facter

   3) Put custom facts in the directory you just made

   4) Enable pluginsync on master  clients

   That should be it, unless I've forgotten something (which would never
   happen of course)  ;)

   # ls /etc/puppet/modules/facts/

   files
   day_of_week.rb
   hardware_platform.rb    # = wiki example

   On Fri, Aug 12, 2011 at 11:42 AM, newguy aimanparv...@gmail.com wrote:

   well i decided to change the route a little, I have decided to make
   a .rb file for adding fact rather then the environment variable and
   heres what am doing and still getting the same error:

   1.  On the puppetmaster in your modules directory create a facts
   module with
   subdirectory files. In this add any of your custom .rb scripts

   # ls /etc/puppet/modules/facts/files
   day_of_week.rb
   hardware_platform.rb    # = wiki example

   2. On the puppetmaster in /etc/puppet/puppet.conf I added:-
      pluginsync = true
      factpath = $vardir/facts    #vardir = /var/lib/puppet

   3. On the puppetmaster in /etc/puppet/fileserver.conf I added:-
   [facts]
   path /var/lib/puppet/facts

   4. On the server I added the file  /etc/profile.d/facter.sh
   containing
   export FACTERLIB=/var/lib/puppet/facts

   after this again when I connect the client to puppet server I get the
   following error:

   err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
   resource: Could not retrieve information from source(s)
   puppet://puppet/plugins

   Help guys!!!

   On Aug 12, 8:32 am, newguy aimanparv...@gmail.com wrote:
Yes fact exists as a environment variable only
Any suggestions anyone???
On Aug 12, 7:50 am, Guy Matz gm...@matz.org wrote:

 Oh, wait . . .  that fact exists solely as an environment variable?
    You
 haven't put that code in a file for distribution?  Then please ignore
   my
 previous response.  Sorry

 On Fri, Aug 12, 2011 at 10:30 AM, newguy aimanparv...@gmail.com
   wrote:
  Guys
  I made a custom fact using export;(export FACTER_envt=`hostname
   -s|cut
  -c 1-2`;) on puppet master, and when I do facter envt it shows the
  desired result, now my problem is that am unable to distribute it 
  to
  the client machines.

  I read up a little on adding custom facts and found out the
   pluginsyc
  would help me but it didnt, I have pluginsync=true on both
  puppetmaster and client but still when I do sudo puppetd --test --
  pluginsync on client it says the following:

  err: /File[/var/lib/puppet/lib]: Failed to retrieve current state 
  of
  resource: Could not retrieve information from source(s)
  puppet://puppet/plugins

  On client /var/lib/puppet/lib has no directory
  On server /var/lib/puppet/lib has puppet and facter directories

  sudo puppetd --configprint factpath on client is
    /var/lib/puppet/lib/
  facter and on server its the same.

  Please help.

  Thanks

  --
  You received this message because you are subscribed to the Google
   Groups
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.

   --
   You received this message because you are subscribed to the Google Groups
   Puppet Users group.
   To post to this group, send email to puppet-users@googlegroups.com.
   To unsubscribe from this group, send email to
   puppet-users+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this 

Re: [Puppet Users] Re: unable to distribute custom facts

2011-08-12 Thread Aaron Grewell
Yes, you'll have to include the master in your class and run the agent on
the master first I think. Then the clients should work.
On Aug 12, 2011 3:20 PM, newguy aimanparv...@gmail.com wrote:
 well my thing worked(partly) I just had to put the fact (envt.rb) in /
 etc/puppet/modules/facts/lib/facter/files. I can see the fact when I
 did facter -p on client but the problem is this fact is not available
 on the puppet master. I executed this simple code(a test module) to
 reach this conclusion, please help

 class test_mod {
 if $envt=='ip'{
 file {/home/ubuntu/a:
 ensure=file
 }
 }
 else {
 file {/home/ubuntu/ai:
 ensure=file
 }
 }

 file ai was made .

 Please help


 On Aug 12, 2:17 pm, Aaron Grewell aaron.grew...@gmail.com wrote:
 Oh, and include module 'facts' on every node where these facts will be
 used.  That could be somewhat important.

 On Fri, Aug 12, 2011 at 2:15 PM, Aaron Grewell aaron.grew...@gmail.com
wrote:







  IIRC you're doing this the hard way.  The easy way:
  1) Create a module:
  mkdir -p /etc/puppet/modules/facts

  2) Create the pluginsync directories in your module
  mkdir -p /etc/puppet/modules/facts/lib/facter

  3) Put custom facts in the directory you just made

  4) Enable pluginsync on master  clients

  That should be it, unless I've forgotten something (which would never
  happen of course)  ;)

  # ls /etc/puppet/modules/facts/

  files
  day_of_week.rb
  hardware_platform.rb# = wiki example

  On Fri, Aug 12, 2011 at 11:42 AM, newguy aimanparv...@gmail.com
wrote:

  well i decided to change the route a little, I have decided to make
  a .rb file for adding fact rather then the environment variable and
  heres what am doing and still getting the same error:

  1.  On the puppetmaster in your modules directory create a facts
  module with
  subdirectory files. In this add any of your custom .rb scripts

  # ls /etc/puppet/modules/facts/files
  day_of_week.rb
  hardware_platform.rb# = wiki example

  2. On the puppetmaster in /etc/puppet/puppet.conf I added:-
 pluginsync = true
 factpath = $vardir/facts#vardir = /var/lib/puppet

  3. On the puppetmaster in /etc/puppet/fileserver.conf I added:-
  [facts]
  path /var/lib/puppet/facts

  4. On the server I added the file  /etc/profile.d/facter.sh
  containing
  export FACTERLIB=/var/lib/puppet/facts

  after this again when I connect the client to puppet server I get the
  following error:

  err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
  resource: Could not retrieve information from source(s)
  puppet://puppet/plugins

  Help guys!!!

  On Aug 12, 8:32 am, newguy aimanparv...@gmail.com wrote:
   Yes fact exists as a environment variable only
   Any suggestions anyone???
   On Aug 12, 7:50 am, Guy Matz gm...@matz.org wrote:

Oh, wait . . .  that fact exists solely as an environment
variable?
   You
haven't put that code in a file for distribution?  Then please
ignore
  my
previous response.  Sorry

On Fri, Aug 12, 2011 at 10:30 AM, newguy aimanparv...@gmail.com
  wrote:
 Guys
 I made a custom fact using export;(export FACTER_envt=`hostname
  -s|cut
 -c 1-2`;) on puppet master, and when I do facter envt it shows
the
 desired result, now my problem is that am unable to distribute
it to
 the client machines.

 I read up a little on adding custom facts and found out the
  pluginsyc
 would help me but it didnt, I have pluginsync=true on both
 puppetmaster and client but still when I do sudo puppetd --test
--
 pluginsync on client it says the following:

 err: /File[/var/lib/puppet/lib]: Failed to retrieve current
state of
 resource: Could not retrieve information from source(s)
 puppet://puppet/plugins

 On client /var/lib/puppet/lib has no directory
 On server /var/lib/puppet/lib has puppet and facter directories

 sudo puppetd --configprint factpath on client is
   /var/lib/puppet/lib/
 facter and on server its the same.

 Please help.

 Thanks

 --
 You received this message because you are subscribed to the
Google
  Groups
 Puppet Users group.
 To post to this group, send email to
puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.

  --
  You received this message because you are subscribed to the Google
Groups
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email 

[Puppet Users] Re: hasstatus not working as expected

2011-08-12 Thread Chad
Thanks for the regex fix.  I am terrible at those, that probably took
me 10 minutes to get that far...

And my environment has nothing declared with grep.

I thought more about this, and I am thinking the problem might have
come up when RHEL 5.7 came out.  I tested on a few RHEL 6 boxes and
this works fine.  But I can't figure out what would have changed that
still allows me to run it fine but puppet fails.

On Aug 12, 5:10 pm, Tim Mooney tim.moo...@ndsu.edu wrote:
 In regard to: [Puppet Users] Re: hasstatus not working as expected, Chad...:

  status)
       /sbin/iptables -L | /bin/egrep '^DROP+\s+all.*NEW\s?+$'  /dev/
  null

 I doubt this is the actual problem, but you could more portably and
 more correctly write that regex as

         '^DROP[[:space:]]+all.*NEW[[:space:]]*$'

 You don't need the + after the P, since you don't want to match things
 like DROP, and you don't need the ? or the + after NEW, since you're
 anchoring the end and there's therefore really no reason to use non-greedy
 matching.  Your comment also mentions any amount of whitespace, which
 presumably includes 0 matches, hence the * instead of the +.

 Also, you should probably run (as you)

         env grep -i grep

 and see if something like GREP_OPTIONS is in your environment.

  # A string has to start with DROP then whitespace, then all, then
  anything, then NEW, then any amount of whitespace
  # For some reason iptables -L has a whitespace after NEW
       if [ $? = 0 ]; then
          echo iptables is running
          exit 0
       else
          echo iptables is stopped
          exit 3
       fi
       ;;
  **

 Tim
 --
 Tim Mooney                                  moo...@dogbert.cc.ndsu.nodak.edu
 Enterprise Computing  Infrastructure       701-231-1076 (Voice)
 Room 242-J6, IACC Building                  701-231-8541 (Fax)
 North Dakota State University, Fargo, ND 58105-5164

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: enviroments are not being used

2011-08-12 Thread Frederiko Costa
Hi newguy,

Thanks for your help. However, it did not work. In fact, I had tried that
previously. The approach you mentioned, I think it's the approach that the
Pro Puppet book take. It did not work either. Still gets the production
one:

Here is the output when I set puppermaster to --debug --no-daemonize:

debug: importing '/etc/puppet/manifests/nodes.pp'
debug: importing '/etc/puppet/modules/ssh/manifests/init.pp'
info: Autoloaded module ssh
debug: importing '/etc/puppet/modules/ssh/manifests/params.pp'
info: Autoloaded file ssh/params from module ssh
debug: No true answers and no default
warning: Scope(Class[ssh]): The 'require' function is only compatible with
clients at 0.25 and above; including class but not adding dependency
debug: importing '/etc/puppet/modules/ssh/manifests/install.pp'
info: Autoloaded file ssh/install from module ssh
debug: importing '/etc/puppet/modules/ssh/manifests/config.pp'
info: Autoloaded file ssh/config from module ssh
debug: importing '/etc/puppet/modules/ssh/manifests/service.pp'
info: Autoloaded file ssh/service from module ssh

Is there any other thing you or someone else suggests?

Regards,
-fred




On Fri, Aug 12, 2011 at 3:15 PM, newguy aimanparv...@gmail.com wrote:

 in continuation.
 and put/copy your modules in the path, that should do the trick.

 On Aug 12, 3:14 pm, newguy aimanparv...@gmail.com wrote:
  give the module path in development
  [development]
  modulepath = /etc/puppet/environments/development/modules
 
  Thanks
 
  On Aug 12, 2:39 pm, Frederiko Costa freder...@gmail.com wrote:
 
 
 
 
 
 
 
   Hello everyone,
 
   I have the following environments configured as master:
 
   # puppetmasterd -V
   0.25.4
 
   # cat puppet.conf
   [main]
confir=/etc/puppet
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
pidfile=$rundir/puppetmasterd.pid
factpath=$vardir/lib/facter
pluginsync=true
templatedir=$confdir/templates
prerun_command=/etc/puppet/etckeeper-commit-pre
postrun_command=/etc/puppet/etckeeper-commit-post
 
   [master]
  
 modulepath=$confdir/environments/$environment/modules:$confdir/modules
 manifest=$confdir/manifests/unknown.pp
 
   [development]
manifest   = $confdir/manifests/site.pp
 
   [testing]
manifest   = $confdir/manifests/site.pp
 
   I have the modules in place, for every environment. This does not seem
 to be
   an issue. Certificates are correctly signed.
   The problem is that my agent located on another host, does not load the
   development environment whenever I run the following command:
   # puppetd -V
   0.25.4
 
   # puppetd agent --verbose --server=lbre-puppet.stanford.edu --noop
 --test
   --environment development
 
   I get the following in the agent when I run the command above:
 
   info: Caching catalog for ganglia01.stanford.edu
   info: Applying configuration version '1313184594'
   notice: //gangliamonitor::service/Service[ganglia-monitor]/ensure: is
   stopped, should be running
   (noop)
   notice: Finished catalog run in 0.11 seconds
 
   It runs fine, but not the development environment. I even mess it up
 the
   development module to make sure it was running something different. It
 runs
   the main one. The master's output is the regular output as if I had ran
   without the --environment switch.
 
   Does anyone know what could be missing or causing this behavior?
 
   I appreciate in advance.
 
   -Fred

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Parse Puppet Manifests

2011-08-12 Thread Andrew Thompson


On Aug 11, 3:48 pm, Nan Liu n...@puppetlabs.com wrote:
 On Thu, Aug 11, 2011 at 2:32 PM, Andrew Thompson netengr2...@gmail.com 
 wrote:
  I am looking for a method to parse the entire set of puppet manifests/
  modules.  For example I want to see a list of all packages that I am
  managing with puppet.  I have seen the compile option, but this only
  gives me a particular node's point of view.  While I could just scrape
  all of the manifest files for this information with grep, etc., there
  must be something in the puppet code base I could plug into??

 I'm not aware how you can obtain this without compiling and obtaining
 the catalog for a target node. For example, there's no easy way of
 determining what package the following manifests controls without
 knowing $package_list (which could be from an external source, such as
 extlookup, enc):

 package { $package_list:
   ensure = latest,

 }

 The client's catalog can be examined and aggregated to review what's
 managed on all your target systems. Also what's the interest of
 knowing some package X is in the puppet manifests if it's never used
 on any system? I guess the question is what's your goal?

In this particular example I am interested in the list of packages
that I am managing with puppet so that I can build a custom package
mirror with those packages.

 Thanks,

 Nan

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.