Re: [Puppet Users] randomize minute

2011-04-19 Thread Rohan McGovern
Luc Suryo said:
 Hello
 
 I.m trying to get a 'static random' base on a node's ip address and
 use that number as the minute for a crontab
 so each node will get a number between and 59
 
 The things is the number is generated by the puppet master and so all
 node get the same value...
 
 my current code :
 
 random_minute = generate('/usr/bin/env', 'bash', '-c', 'host `uname
 -n` | head -1 | awk \'{ print $4 }\' | awk -F . \'{ printf(%d\n,
 ($1+$2+$3+$4)%60); }\'')
 
 
 So Im a lost what do i need to do so 'generate' used the node's IP and
 not puppetmaster...
 
 

Did you perhaps want the fqdn_rand() function?

This gives a static random number based on the node's fqdn (not IP
like you asked for, but hopefully usable anyway).

I use it like this:

$minute1 = fqdn_rand(15)
$minute2 = 15+$minute1
$minute3 = 30+$minute1
$minute4 = 45+$minute1

cron { run puppet:
command =  $puppetrun,
user=  root,
minute  =  [ $minute1, $minute2, $minute3, $minute4 ],
require =  File[$sysadmindir],
}

(from 
https://gitorious.org/qtqa/sysadmin/blobs/master/puppet/modules/puppet/manifests/unix.pp
 )

Only think I can't remember is if it returns an integer from 0 .. 14 or 0 .. 15 
:)
-- 
Rohan McGovern
Quality Engineer
Qt Development Frameworks, Nokia

-- 
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] dot in file path

2011-02-10 Thread Rohan McGovern
dragonfly said:
 I wish to have puppet copy a file to /etc/cron.hourly/ on target
 machines, however when puppetmaster attempts to build the catalog it
 complains about a syntax error in both nodes.pp as well as in the
 manifest init.pp for this class.  I have experimented with various
 quotings as well as escaping the dot character with no success.  Can
 anyone shed light on a solution?
 
 puppetmaster 2.6.2 on Debian Wheezy 6.0

Hello :)

There is no problem to put dots in a path:

  file { /etc/cron.hourly/walk_the_dog:
 source = puppet:///modules/dogwalker/walk_the_dog.cron,
  }

Maybe you could show the actual code and syntax error?
-- 
Rohan McGovern
Quality Engineer
Qt Development Frameworks, Nokia

-- 
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] puppet server not responding

2011-02-09 Thread Rohan McGovern
Tim Dunphy said:
 hello list
 
  I am attempting to setup a puppet server in the amazon cloud. When I
 try to hit the host from the test client using puppetd --test I get
 this response...
 
 
 
 
 [root@mclient ~]# puppetd --test
 err: Could not retrieve catalog from remote server: getaddrinfo: Name
 or service not known
 warning: Not using cache on failed catalog
 err: Could not retrieve catalog; skipping run

Hello,

In my experience an error like this means that the hostname on your
machine may not be set correctly, check outputs of `facter fqdn' and
`hostname -f'.
-- 
Rohan McGovern
Quality Engineer
Qt Development Frameworks, Nokia

-- 
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] Puppet and Andorid

2010-08-09 Thread Rohan McGovern
Daniel Pittman said:
 Aaron Lippold aaron.l.lipp...@us.army.mil writes:
 
  We have some interest on looking at Puppet on Android - it's just another
  distro right?
 
 I am *really* curious, though: what were you hoping to *do* with puppet?

I can't speak for Aaron, and my own interest doesn't include Android at
the moment.  But I do run puppet on some Linux phone simulator environments
and intend to run it on the real devices too.  Why not, if it's possible?
They need to be managed, just like everything else.
-- 
Rohan McGovern
QA Engineer
Qt Development Frameworks, Nokia

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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] exec not finding shell builtins/functions?

2010-07-29 Thread Rohan McGovern
Greg Graf said:
 Hello,
 
 We're running 2.6 on Ubuntu 10.04 and here's what I'm seeing (simplified 
 test):
 
 class cdtest {
   exec {'cdtest': command = 'cd' }
 }
 
 # puppet agent --test
 info: Caching catalog for servername
 info: Applying configuration version '1280441519'
 err: /Stage[main]/Cdtest/Exec[cdtest]/returns: change from notrun to 0 
 failed: Could not find command 'cd'
 notice: Finished catalog run in 0.65 seconds
 #
 
 Any ideas on why this is failing? I am running into this with rvm as well 
 (since it is a function and not a binary).
 

Isn't this by design?  Unless the puppet docs say that exec is always
run through a shell, then I wouldn't expect it to be.

In my manifests, if I want a shell, I explicitly use:

 command = '/bin/sh -c some shell commands'
-- 
Rohan McGovern
QA Engineer
Qt Development Frameworks, Nokia

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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] ANNOUNCE: Puppet 2.6.0 - Final release!

2010-07-19 Thread Rohan McGovern
James Turnbull said:
 The journey was long and arduous and many fell along the way but Puppet
 Labs is proud to announce the 2.6.0 release!
 

Is anyone aware of an attempt to package up a complete (puppet + all
prereqs) installer for Windows?  Either official, or by someone in the
community?

And, asking from the other direction: would anyone else be interested in
such a thing?

I would be, because setting up puppet on Windows seems pretty tough
right now.  I also have no need for Ruby on my Windows boxes except
for the usage of puppet.
-- 
Rohan McGovern
QA Engineer
Qt Development Frameworks, Nokia

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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] dpkg in puppet returns 2 but at command line returns 0

2010-07-12 Thread Rohan McGovern
ext Jon Choate said:
 I have an exec defined as
 
 exec {dpkg --configure -a:
path = /usr/bin:/bin,
user = root
 }
 
 puppet complains:
 
 Exec[dpkg --configure -a]/returns: change from notrun to 0 failed: dpkg 
 --configure -a returned 2 instead of one of [0]
 
 but when I run dpkg --configure -a outside puppet it returns 0.
 
 Has anyone ever seen this before or have any insights?
 

The last time someone reported a problem like this on the mailing list,
it was because the command had to run a subcommand which was not in
PATH.

In particular, `dpkg --configure' runs postinst scripts for packages
and these might do absolutely anything... at the very least I would
expect that /usr/sbin and /sbin probably need to be in PATH too :-)
-- 
Rohan McGovern
QA Engineer
Qt Development Frameworks, Nokia

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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] multiple OS support conventions?

2010-05-12 Thread Rohan McGovern
On Tuesday 11 May 2010, ext Dick Davies wrote:
 I've been using Puppet very happily for the last 6 months
 or so to manage our CentOS and RHEL servers.

 Over the summer I want to knock things up a notch bam /,
 and part of that is going to be supporting a wider range of OSes.
 First on the hit list are likely to be Solaris 10 and Suse
 (SLES).

 I know a lot of people do support multiple OSes, just wondered
 what sort of approach you've found works best?


I've been doing it like this, for an example module 
named baselayout:

 modules/baselayout/manifests/init.pp:

import *
class baselayout {
  case $operatingsystem {
Darwin:   { include baselayout::mac }
OpenSuSE: { include baselayout::suse }
  }
}


 modules/baselayout/manifests/mac.pp:

class baselayout::mac {
   ...
}


 modules/baselayout/manifests/suse.pp:

class baselayout::suse {
   ...
}


 ... etc.  I've just started, so there could be problems with this I 
haven't hit yet.

-- 
Rohan

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.