Re: [Puppet Users] Optional template files?

2012-06-29 Thread Darren Chamberlain
u can use it with inline_template(): file { "/etc/snmpd.conf": ensure => "present", content => inline_template( file( "puppet:///modules/snmp/snmpd.conf.$::hostname.erb", "p

Re: [Puppet Users] Re: Testing if a puppet class is going to be installed

2011-07-07 Thread Darren Chamberlain
Did I miss the part where it was determined that having one class require the other one(s) didn't work? * Disconnect [2011/07/07 14:57]: > On Thu, Jul 7, 2011 at 2:10 PM, Keith Minkler wrote: > > > This use case comes up a lot. There are some functions but > > > historically they have not been r

Re: [Puppet Users] tolower()??

2011-07-21 Thread Darren Chamberlain
* David Kavanagh [2011/07/21 16:10]: > I need to convert a value from facter to lower case for inclusion > in a path. Is there a built-in function for that? $ cat /tmp/foo.pp $foo = "STUFF" $foo_l = inline_template("<%= foo.downcase %>") notice("$foo -> $foo_l") $ puppet /tmp/foo.pp

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

2011-08-12 Thread Darren Chamberlain
; 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 -- You received thi

[Puppet Users] Dynamic lookup of $var

2011-08-18 Thread Darren Chamberlain
asses. $operatingsystem is a facter variable, of course. How are these supposed to be referenced? -- Darren Chamberlain -- 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.

Re: [Puppet Users] Dynamic lookup of $var

2011-08-18 Thread Darren Chamberlain
On 8/18/2011 12:08 PM, Gary Larizza wrote: On Thu, Aug 18, 2011 at 9:06 AM, Darren Chamberlain wrote: > $operatingsystem is a facter variable, of course. How are these > supposed to be referenced? They're referenced like this: $::operatingsystem This works, thanks. While I hav

Re: [Puppet Users] Can I serve a template depending on if it exists like I can a source?

2012-01-05 Thread Darren Chamberlain
It's been a while since you asked this, but I didn't see a followup; forgive the noise if you've already got an answer. Wolf Noble posted a solution to this problem in September that I've been holding onto because I think it's elegant: * Wolf Noble [2011/09/01 18:45]: > Here's what I've bee

Re: [Puppet Users] snmp class

2012-01-06 Thread Darren Chamberlain
have a fallback. Note that you can use any facts in there, so stuff like $operatingsystem, $operatingsystemrelease, and $kernel are available. -- Darren Chamberlain -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, sen

Re: [Puppet Users] snmp class

2012-01-06 Thread Darren Chamberlain
ments, but have a fallback. Note that you can use any facts > in there, so stuff like $operatingsystem, $operatingsystemrelease, > and $kernel are available. -- Darren Chamberlain -- You received this message because you are subscribed to the Google Groups "Puppet Users" grou

Re: [Puppet Users] Question about templates from variables

2010-05-28 Thread Darren Chamberlain
* James Cammarata [2010/05/28 10:09]: > My primary motivation for this is something like sudoers, where > certain system roles require sudoers commands for different groups > to use. But sudoers has native support for exactly this use case, in that you can assign permissions based on host as well

Re: [Puppet Users] vardir variable not coming through

2010-07-02 Thread Darren Chamberlain
* noob-puppeteer [2010/07/01 18:00]: > I must be missing something with how puppet.conf works. > > I have configured puppet.conf like so: > [main] > vardir = /var/xyz/puppet > > I have a very simple site.pp > > file { "$vardir/touch": > ensure => present, > } > > I am running puppet 0

Re: [Puppet Users] [puppet-users] apt and gem package with the same name

2010-07-02 Thread Darren Chamberlain
* hernan [2010/06/30 17:02]: > I'm building a puppet manifest for an Ubuntu machine that needs to > have both of these on it: > > package { "memcached": > provider => gem, > ensure => "0.18.0" > } > > package { "memcached": > provider => apt, > ensure => installed > } I

Re: [Puppet Users] Re: puppet and augeas to keep ntp.conf

2010-07-12 Thread Darren Chamberlain
Since you're using the same three NTP servers, couldn't you just copy ntp.conf from a fileserver? * altimon [2010/07/12 16:35]: > Hi Rob and ALL, > > Unfortunately, > > following pp file creating 1st instances and then are adding new > ( I've tried just one ntp1 or triad ntp1,2,3 ) > > class n

Re: [Puppet Users] Downloading files to Puppet clients from HTTP Server

2010-08-18 Thread Darren Chamberlain
* Ahmed El Gamil [2010/08/18 17:17]: > I was working on some puppet recipe and came to the need where i > want to download a file from an HTTP server, usually i use the > "file" resource type with the "source" parameter to push files to > the clients, but in this situation i just need to download

Re: [Puppet Users] Realize different user/groups on different systems

2010-08-23 Thread Darren Chamberlain
* Stefan Schulte [2010/08/23 10:56]: > Maybe the best approach is to have a definition that will figure > out the right owner and group by looking at the opertingsystem and > the path of the file (like 'all files under /etc/ should have > root:sys under solaris und bin:bin under HP-UX). I solved

Re: [Puppet Users] Re: quoting special characters in puppet.conf

2010-08-27 Thread Darren Chamberlain
s passed through is \$HeadURL. Thus, this is untested speculation, but it can't hurt to try: diff_args = -ubB -I \\\$HeadURL -- Darren Chamberlain -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, sen

Re: [Puppet Users] Puppet + APT, I am lost...

2010-08-31 Thread Darren Chamberlain
* Martijn Grendelman [2010/08/31 22:02]: > What I would like, is for Puppet to run `aptitude update` before > it installs or upgrades packages. That doesn't seem out of the > ordinary to me, but I can't make it work in Puppet. I would do the `aptitude update` in cron, outside of puppet, and manag

Re: [Puppet Users] Specifying version for shared packages

2010-09-14 Thread Darren Chamberlain
I do this kind of thing in a few places, for things like different or specific versions of mysql, tomcat, libraries, and so on. I use a define to wrap this up, and the declare is called from within the node defitions. A simplified example of our method: define install ($version) { package

Re: [Puppet Users] Glassfish asadmin provider

2010-09-15 Thread Darren Chamberlain
* Nan Liu [2010/09/15 12:08]: > Check some hard coded path, and tries to detect if it's available in $PATH > using which: > > case > when File.executable?("/opt/NSBglassfish/bin/asadmin") > commands :asadmin => "/opt/NSBglassfish/bin/asadmin" > when File.executable?("/usr/local/NSBglassfish/bin

Re: [Puppet Users] Glassfish asadmin provider

2010-09-15 Thread Darren Chamberlain
* Nigel Kersten [2010/09/15 12:30]: > On Wed, Sep 15, 2010 at 12:25 PM, Darren Chamberlain > wrote: > > I have no comment on the general approach, but just wanted to point > > out that checking $? doesn't necessarily work everywhere: > > > > $ uname -a

Re: [Puppet Users] Glassfish asadmin provider

2010-09-15 Thread Darren Chamberlain
* Darren Chamberlain [2010/09/15 15:41]: > * Nigel Kersten [2010/09/15 12:30]: > > Does 'type --all asdf' do the right thing on SunOS ? > > $ uname -a ; /bin/type --all asdf ; echo $? > SunOS smacky 5.10 Generic_142900-03 sun4v sparc SUNW,Sun-Fire-T200 Solari

Re: [Puppet Users] best way to include a variable in many modules ?

2010-09-23 Thread Darren Chamberlain
* Daniel Maher [2010/09/23 18:36]: > Consider : > > s...@abc$ facter | grep domain > domain => abc.dom.ain > > s...@xyz$ facter | grep domain > domain => xyz.dom.ain > > Thus i would like a template "resolv.conf.erb" : > > search <%= site_name =>.dom.ain Why not use: search <%= domain %> ?

Re: [Puppet Users] obtaining stdout information from client configuration executions

2010-09-24 Thread Darren Chamberlain
We're not using a puppetmaster, so we're collecting info on runs via syslog and puppet -v: puppet -v /path/to/manifest.pp | logger -t puppet And then we're using a splunk-alike to run ad-hon reports on the logs. * Tim Lank [2010/09/24 06:52]: > I'm trying to find a way to obtain the stdout (a

Re: [Puppet Users] Re: Problems with Solaris 10 & adduser

2010-10-14 Thread Darren Chamberlain
According to http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/head/userdefs.h#118, an exit status of 1 means No permission. (See http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/oamuser/user/useradd.c for the source to useradd.) * nickt [2010/10/14 12:32]: > Thu Oct

Re: [Puppet Users] Re: Problems with Solaris 10 & adduser

2010-10-14 Thread Darren Chamberlain
thing on > Solaris? Give puppet user permissions to execute useradd via ACL/ > roles or something? > > On Oct 14, 2:50 pm, Darren Chamberlain wrote: > > According > > tohttp://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/head/us..., > > an exit status o

Re: [Puppet Users] Accessing Facter in other languages than Ruby?

2010-10-22 Thread Darren Chamberlain
* Richard Crowley [2010/10/22 08:57]: > > We're writing a few scripts at the moment that could really make > > use of Facter, however the vast majority of them team (including > > my self!) are not proficient in Ruby, however they are highly > > proficient in other languages such as (dare I say it

Re: [Puppet Users] Re: Prevent users from creating new accounts

2010-11-04 Thread Darren Chamberlain
It sure sounds like you need to be distributing a canonical /etc/passwd, /etc/shadow, and /etc/groups on every puppet run. * hywl51 [2010/11/04 03:11]: > Yes, you said it. Unfortunately, we have some users running as > root privilege on server, because they cann't work without it. > > But we do

Re: [Puppet Users] Re: Prevent users from creating new accounts

2010-11-08 Thread Darren Chamberlain
* Bruce Richardson [2010/11/05 09:01]: > [...] If developers, then there is always a way round - sudo, > fakeroot, giving them virtual hosts to play with. I'd like to second the virtual host suggestion -- throwaway VMs (or zones, in solaris) work really well for this kind of situation. Additiona

Re: [Puppet Users] Large hierarchy of files?

2010-11-12 Thread Darren Chamberlain
* ericlee748 [2010/11/10 14:09]: > I have a large hierarchy of files that are set up to recursively > copy from my puppet master. It takes a long while to copy these > files over to the clients - roughly 1 hour. Only 1 or 2 files in > the hierarchy will ever change. Is there a better way to do wha

Re: [Puppet Users] Re: how to do conditional check?

2011-06-13 Thread Darren Chamberlain
* Sans [2011/06/13 02:21]: > Any suggestion from anyone else? Is there a way to check "if a > directory (or file) already exists, then do something" in Puppet? > Cheers!! I use this pattern: $_exists = inline_template("<%= File.exists?('$f') %>") case $_exists { "true": { ... } "

Re: [Puppet Users] Number of characters in string/variable

2012-07-09 Thread Darren Chamberlain
:59]: > I'm looking for a way to determine the number of characters in a > string/variable. I've tested some of the ruby length functions, but no > luck. Has anyone done this before? -- Darren Chamberlain -- You received this message because you are subscribed to the Google Grou

Re: [Puppet Users] Running "make" via puppet manifest

2012-08-01 Thread Darren Chamberlain
rc/ChelsioUwire-1.0.2.26 > make KDIR=/usr/src/linux-headers-2.6.32-41]/returns: change from notrun to > 0 failed: /usr/src/ChelsioUwire-1.0.2.26 make > KDIR=/usr/src/linux-headers-2.6.32-41 returned 1 instead of one of [0] at > /etc/puppet/modules/install-lei_chelsio_driver/manifes