[Puppet Users] Using variables in virtual resources

2009-09-18 Thread Kenneth Holter
Hi.


I've defined a virtual user kenneth, and depending on a variable in the
node definiton I'd like to add the users to different groups. Consider this
example:

##  Code start

node server.example.com {
   $server_type = typeA

   realize User[kenneth]

}

  @user {kenneth:
ensure = present,
uid = 1000,
gid = 1000,
groups = $server_type ? {
   typeA = wheel,
   default = undef,
},

home = /home/kenneth,
shell = /bin/bash,
comment = A comment,
password = 'something'

 }

## Code end

If I add the user to an ordinary class (like class user_kenneth) instead
of defining it as a virtual resource, everything works fine. But when using
a virtual definition like this, the variable server_type doesn't seem to
have any effect on the if statement groups. Am I doing something wrong, or
is this not supposed to work? I'm running version 0.24.4.



Best regards,

Kenneth Holter

--~--~-~--~~~---~--~~
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: Best Practices Rewrite - First Draft

2009-09-18 Thread David Schmitt

Julian Simpson wrote:
 I would have assumed that you'd always want to qualify the module
 names as the best practise.  Collisions in namespaces wreak havoc in
 many other domains.  I'm thinking of Java class names being bound to
 domain names as an approach that works elsewhere.

Like rpm/deb packages, modules have a well regulated namespace. Iff 
there were a clash, those modules would probably come from two different 
implementors and quite likely do have different enough requirements and 
overlapping contents that they don't work together anyways.

That being said apache just is much easier to type than 
at.co.black.puppet.apache.[1]

Regards, DavidS



[1] and also would ruin the pun ;-)

--~--~-~--~~~---~--~~
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: cannot parse template when fact does not exist

2009-09-18 Thread David Schmitt

Chris Blumentritt wrote:
 I receive the following error when trying to do the puppet below:
 Failed to parse template s_apache_site/site.conf.erb: Could not find 
 value for 'ipaddress_eth0_0'
 
 As far as I can tell the ipaddress_eth0_0 fact has to exist on the 
 client before it will parse.  I was hoping that I could get the new ip 
 address in place thus creating the fact so that when the apache site is 
 created the information would be available.  Maybe all facts are 
 compiled at the when puppetd is run and there is no way to add facts 
 during the run of puppetd?

puppet sends all facts to the server at the beginning of each run to 
receive an updated configuration. The configuration is compiled 
(functions run, templates expanded) on the server before passing it on 
to the client. The latter only receives a list of resources which it 
dutifully applies.

Therefore it is impossible to create facts on the fly: the client 
doesn't have enough information to re-compile its manifests.

This is one of the few cases (enabling providers is another major one) 
where you have to defer some resources until the next run, where you 
have the facts available.

 The way I see around this is to first add the ip address with out 
 calling the apache::site definition and once the ip address gets on 
 there run puppet with apache::site definition.  There has got to be 
 better way, any suggestions

If you really want to avoid the second run, you can refactor your 
manifest so you are not using a fact in you template, but directly the 
configuration information:


node web1{
$secondary_ip = xxx

network::ip { $secondary_ip: }
apache::site { blah: ip = $secondary_ip }
}


Regards, DavidS

--~--~-~--~~~---~--~~
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] ensure = true not working for sshd

2009-09-18 Thread Ben Lavender

Hello,

I'm confused why puppet wont start a service I have configured.

In the module, which is definitely being run (everything else in it
works):

service { ssh:
   name = 'sshd',
   ensure = true,
   enable = true
 }

As I understand the docs, the ensure = true should start sshd if it
is not running (or at least try to).  But when I turn off ssh on a
managed host, it's not started by puppet.

[r...@opstest-host-3 yum.repos.d]# service sshd stop
Stopping sshd: [  OK  ]
[r...@opstest-host-3 yum.repos.d]# !/etc
/etc/init.d/puppet once
[r...@opstest-host-3 yum.repos.d]# !ta
tail -f /var/log/puppets.log
Sep 18 04:18:17 opstest-host-3 puppetd[13199]: Reopening log files
Sep 18 04:18:21 opstest-host-3 puppetd[13199]: Starting catalog run
Sep 18 04:18:32 opstest-host-3 puppetd[13199]: Finished catalog run in
10.93 seconds

Can anyone point me to what I'm doing wrong?
--~--~-~--~~~---~--~~
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: ensure = true not working for sshd

2009-09-18 Thread David Schmitt

Ben Lavender wrote:
 Hello,
 
 I'm confused why puppet wont start a service I have configured.
 
 In the module, which is definitely being run (everything else in it
 works):
 
 service { ssh:
name = 'sshd',
ensure = true,
enable = true
  }
 
 As I understand the docs, the ensure = true should start sshd if it
 is not running (or at least try to).  But when I turn off ssh on a
 managed host, it's not started by puppet.
 
 [r...@opstest-host-3 yum.repos.d]# service sshd stop
 Stopping sshd: [  OK  ]
 [r...@opstest-host-3 yum.repos.d]# !/etc
 /etc/init.d/puppet once
 [r...@opstest-host-3 yum.repos.d]# !ta
 tail -f /var/log/puppets.log
 Sep 18 04:18:17 opstest-host-3 puppetd[13199]: Reopening log files
 Sep 18 04:18:21 opstest-host-3 puppetd[13199]: Starting catalog run
 Sep 18 04:18:32 opstest-host-3 puppetd[13199]: Finished catalog run in
 10.93 seconds
 
 Can anyone point me to what I'm doing wrong?

Depending on your /etc/init.d/ssh's capabilities you either have to 
specify hasstatus=true or provide a appropriate pattern=.

See the TypeReference for details.


Regards, DavidS


--~--~-~--~~~---~--~~
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: Array of values for (exec) return?

2009-09-18 Thread David Schmitt

John Ingersoll wrote:
 Hi,
 
 I have an exec {} that runs a command line script, for which 0 and 1 are 
 both good return codes. (Specifically, spamassassin update; 1 means no 
 new downloads). I tried
 
 returns = [0,1],

I'm using this for sa-update, in an exec:

 /usr/bin/sa-update ; case $? in 0) /etc/init.d/spamassassin restart;; 1) : ;; 
 *) echo Unknown Error; exit 1;; esac


Regards, DavidS

--~--~-~--~~~---~--~~
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: ensure = true not working for sshd

2009-09-18 Thread Ben Lavender

Thanks for your response.

I went through the type reference a little more closely.  I had
assumed that the provider = redhat (I am running rhel 5) would give
me service xyz start/status/stop/restart on everything, but I see now
that's not the case.  Modules are being updated accordingly :)

However, even after updating this and informing puppet that sshd's
init script has a status command, sshd is not behaving correctly.
Further investigation reveals this is actually a bug in the red hat
init script.  'service sshd status' simply uses pidof to determine if
sshd is running, but sshd forks off existing ssh sessions, allowing
the daemon to be started/stopped/etc while people are still
connected.  pidof finds these and reports that sshd is running, and
puppet has no reason not to believe the init script.

I am off to figure out how to file bugs against RHEL5.  I suppose this
little gotcha is not a bad thing to have on the mailing list for
google to find in any case.

Thanks again for the help!

Ben

On Sep 18, 10:41 am, David Schmitt da...@dasz.at wrote:
 Ben Lavender wrote:
  Hello,

  I'm confused why puppet wont start a service I have configured.

  In the module, which is definitely being run (everything else in it
  works):

  service { ssh:
     name = 'sshd',
     ensure = true,
     enable = true
   }

  As I understand the docs, the ensure = true should start sshd if it
  is not running (or at least try to).  But when I turn off ssh on a
  managed host, it's not started by puppet.

  [r...@opstest-host-3 yum.repos.d]# service sshd stop
  Stopping sshd:                                             [  OK  ]
  [r...@opstest-host-3 yum.repos.d]# !/etc
  /etc/init.d/puppet once
  [r...@opstest-host-3 yum.repos.d]# !ta
  tail -f /var/log/puppets.log
  Sep 18 04:18:17 opstest-host-3 puppetd[13199]: Reopening log files
  Sep 18 04:18:21 opstest-host-3 puppetd[13199]: Starting catalog run
  Sep 18 04:18:32 opstest-host-3 puppetd[13199]: Finished catalog run in
  10.93 seconds

  Can anyone point me to what I'm doing wrong?

 Depending on your /etc/init.d/ssh's capabilities you either have to
 specify hasstatus=true or provide a appropriate pattern=.

 See the TypeReference for details.

 Regards, DavidS
--~--~-~--~~~---~--~~
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: ensure = true not working for sshd

2009-09-18 Thread David Schmitt

Ben Lavender wrote:
 Thanks for your response.
 
 I went through the type reference a little more closely.  I had
 assumed that the provider = redhat (I am running rhel 5) would give
 me service xyz start/status/stop/restart on everything, but I see now
 that's not the case.  Modules are being updated accordingly :)
 
 However, even after updating this and informing puppet that sshd's
 init script has a status command, sshd is not behaving correctly.
 Further investigation reveals this is actually a bug in the red hat
 init script.  'service sshd status' simply uses pidof to determine if
 sshd is running, but sshd forks off existing ssh sessions, allowing
 the daemon to be started/stopped/etc while people are still
 connected.  pidof finds these and reports that sshd is running, and
 puppet has no reason not to believe the init script.


That's exactly the reason (I presume) why the redhat provider doesn't 
set hasstatus.


Regards, DavidS

--~--~-~--~~~---~--~~
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: puppetd --server and server option in puppetd.conf

2009-09-18 Thread jcbollinger



On Sep 17, 2:53 pm, David Sowder davidrsow...@gmail.com wrote:
 I'm in the process of upgrading a bunch of our Puppet clients from 0.22.4 to 
 0.24.8 after recently upgrading our puppetmaster similarly.

 I've run into a problem that seems like it'd be so likely seen by someone 
 else that if the problem isn't local, I'd be somewhat surprised, yet at the 
 same time, my install is simply a locally compiled copy of a source RPM from 
 Fedora's EPEL project IIRC (from the .spec file changelog: Mon Mar 23 2009 
 Todd Zullinger t...@pobox.com - 0.24.8-1.1).

 The client is a RHEL 5 x86_64 box and the issue seems to boil down to 
 --server puppet.uta.edu not working as a command-line argument to 
 /usr/sbin/puppetd (with no complaint about an unknown argument like it does 
 with --Server puppet.uta.edu) but working fine if I specify a server = 
 puppet.uta.edu line in my /etc/puppet/puppetd.conf file.  It looks like 
 there is some sort of systematic problem since both --genconfig and 
 --configprint all don't seem to have any effect.

 An example of --server failing to recognized:

 # /usr/sbin/puppetd --server puppet.uta.edu --test
 warning: Certificate validation failed; consider using the certname 
 configuration option
 err: Could not retrieve catalog: Certificates were not trusted: hostname not 
 match with the server certificate (hostname: puppet  CNs: puppet.uta.edu, )
 warning: Not using cache on failed catalog
 #

 (The stuff in parenthesis at the end was a local hack I made to 
 /usr/lib/ruby/1.8/openssl/ssl.rb when trying to track down the issue.)

 /usr/sbin/puppetd --test --configprint all gives the same output as above.

 Any ideas on what I may have screwed up that causes these command-line 
 options to be ignored?  --test is not ignored, so it might have something 
 to do with how the options are defined.

I have no idea what you may have done wrong, if anything, but for my
CentOS 5 / x86(32) environment I downloaded the 0.24.8 source tarball
from ReductiveLabs, updated the included rpm spec file slightly (reply
to me by e-mail if you want details), and built it.  The resulting RPM
works for me, including puppetd command-line options.  It is perhaps
relevant that I have /etc/puppet/puppet.conf on my systems, but no /
etc/puppet/puppetd.conf.

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
-~--~~~~--~~--~--~---



[Puppet Users] Re: puppetd --server and server option in puppetd.conf

2009-09-18 Thread Neil Prockter

jcbollinger wrote:
 
 
 On Sep 17, 2:53 pm, David Sowder davidrsow...@gmail.com wrote:
 I'm in the process of upgrading a bunch of our Puppet clients from 0.22.4 to 
 0.24.8 after recently upgrading our puppetmaster similarly.

 I've run into a problem that seems like it'd be so likely seen by someone 
 else that if the problem isn't local, I'd be somewhat surprised, yet at the 
 same time, my install is simply a locally compiled copy of a source RPM from 
 Fedora's EPEL project IIRC (from the .spec file changelog: Mon Mar 23 2009 
 Todd Zullinger t...@pobox.com - 0.24.8-1.1).

 The client is a RHEL 5 x86_64 box and the issue seems to boil down to 
 --server puppet.uta.edu not working as a command-line argument to 
 /usr/sbin/puppetd (with no complaint about an unknown argument like it does 
 with --Server puppet.uta.edu) but working fine if I specify a server = 
 puppet.uta.edu line in my /etc/puppet/puppetd.conf file.  It looks like 
 there is some sort of systematic problem since both --genconfig and 
 --configprint all don't seem to have any effect.

 An example of --server failing to recognized:

 # /usr/sbin/puppetd --server puppet.uta.edu --test
 warning: Certificate validation failed; consider using the certname 
 configuration option
 err: Could not retrieve catalog: Certificates were not trusted: hostname not 
 match with the server certificate (hostname: puppet  CNs: puppet.uta.edu, )
 warning: Not using cache on failed catalog
 #

 (The stuff in parenthesis at the end was a local hack I made to 
 /usr/lib/ruby/1.8/openssl/ssl.rb when trying to track down the issue.)

 /usr/sbin/puppetd --test --configprint all gives the same output as above.

 Any ideas on what I may have screwed up that causes these command-line 
 options to be ignored?  --test is not ignored, so it might have something 
 to do with how the options are defined.
 
 I have no idea what you may have done wrong, if anything, but for my
 CentOS 5 / x86(32) environment I downloaded the 0.24.8 source tarball
 from ReductiveLabs, updated the included rpm spec file slightly (reply
 to me by e-mail if you want details), and built it.  The resulting RPM
 works for me, including puppetd command-line options.  It is perhaps
 relevant that I have /etc/puppet/puppet.conf on my systems, but no /
 etc/puppet/puppetd.conf.
 
without any shame for quoting myself...

puppetd.conf is no more, use puppet.conf

Many people have had the same confusing situation with --noop being
similarly ignored.

Neil

Please access the attached hyperlink for an important electronic communications 
disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm

--~--~-~--~~~---~--~~
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: puppetd --server and server option in puppetd.conf

2009-09-18 Thread Todd Zullinger
jcbollinger wrote:
 I have no idea what you may have done wrong, if anything, but for my
 CentOS 5 / x86(32) environment I downloaded the 0.24.8 source tarball
 from ReductiveLabs, updated the included rpm spec file slightly (reply
 to me by e-mail if you want details), and built it.

May I ask (if I haven't already asked you before :) if any of the
changes you made might be suitable for the included puppet.spec file
and/or the Fedora/EPEL packaging?

-- 
ToddOpenPGP - KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~
If the human mind was simple enough to understand, we'd be too simple
to understand it.
-- Emerson Pugh



pgpWttFYSWH9X.pgp
Description: PGP signature


[Puppet Users] SLES 10 Install trouble

2009-09-18 Thread Hariharan Gopalan

I am having a hard time installing puppet on an SLES 10 system. I
managed to install ruby, but the x86_64 rpm of puppet from opensuse
repository does not recognize the ruby installation from source.

Was wondering if any one has puppet running on x86_64 SLES10

Thanks
Hari

--~--~-~--~~~---~--~~
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] Mac Domainname and facter

2009-09-18 Thread engle

We have a large number of Macs that are using puppet to install
packages. The source of the packages is determined by the domain name
of the client. We are using ISC's dhcpd. The macs seem to pick up the
correct domain name from the dhcp server but facter is not picking it
up. If I type domainname at a shell prompt, I get nothing. However,
when the client requests a cert from the puppet server, it is
requested with the FQDN which is correct.

So, where does facter get its domain name information from on the
client. I know that Macs have a number of places where they store and
use hostname and domainname. Which one does facter use?

Thanks,

-kurt
--~--~-~--~~~---~--~~
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] Is this bug 2617?

2009-09-18 Thread Allan Marcus

I think this is the same as http://projects.reductivelabs.com/issues/2617

I'm seeing this on Mac OS X 10.5 and puppet 0.25.0. Everything seem to  
work with mongrel, but with passenger, I see on the client:

info: Retrieving fact
debug: Using cached certificate for ca
debug: Using cached certificate for g8626796u39.lanl.gov
debug: Using cached certificate_revocation_list for ca
debug: Format s not supported for Puppet::FileServing::Metadata; has  
not implemented method 'from_s'
debug: Puppet::Network::Format[json]: false value when expecting true
err: /File[/var/puppet/facts]: Failed to generate additional resources  
using 'eval_generate': Error 403 on SERVER: Forbidden
debug: Format s not supported for Puppet::FileServing::Metadata; has  
not implemented method 'from_s'
debug: Puppet::Network::Format[json]: false value when expecting true
err: /File[/var/puppet/facts]: Failed to retrieve current state of  
resource: Error 403 on SERVER: Forbidden Could not retrieve file  
metadata for puppet://puppet-dev.lanl.gov/facts: Error 403 on SERVER:  
Forbidden
debug: Finishing transaction 12791010 with 0 changes

and on the server:
Fri Sep 18 11:29:32 puppet-dev puppetmasterd[869] Notice: Starting  
Puppet server version 0.25.0
Fri Sep 18 11:29:32 puppet-dev puppetmasterd[869] Warning: Denying  
access: Forbidden request: marcusmini-a.lanl.gov(128.165.129.167)  
access to /file_metadata/facts \[search\] at line 0
Fri Sep 18 11:29:32 puppet-dev puppetmasterd[869] Error: Forbidden  
request: marcusmini-a.lanl.gov(128.165.129.167) access to / 
file_metadata/facts \[search\] at line 0
Fri Sep 18 11:29:32 puppet-dev puppetmasterd[869] Warning: Denying  
access: Forbidden request: marcusmini-a.lanl.gov(128.165.129.167)  
access to /file_metadata/facts \[find\] at line 0
Fri Sep 18 11:29:32 puppet-dev puppetmasterd[869] Error: Forbidden  
request: marcusmini-a.lanl.gov(128.165.129.167) access to / 
file_metadata/facts \[find\] at line 0
Fri Sep 18 11:29:34 puppet-dev puppetmasterd[869] Warning: Denying  
access: Forbidden request: marcusmini-a.lanl.gov(128.165.129.167)  
access to /catalog/g8626796u39.lanl.gov \[find\] at line 0
Fri Sep 18 11:29:34 puppet-dev puppetmasterd[869] Error: Forbidden  
request: marcusmini-a.lanl.gov(128.165.129.167) access to /catalog/ 
g8626796u39.lanl.gov \[find\] at line 0



without passenger, the clietn seems to work fine:
info: Retrieving fact
debug: Using cached certificate for ca
debug: Using cached certificate for g8626796u39.lanl.gov
debug: Using cached certificate_revocation_list for ca
debug: Format s not supported for Puppet::FileServing::Metadata; has  
not implemented method 'from_s'
debug: Puppet::Network::Format[json]: false value when expecting true
debug: Finishing transaction 12791010 with 0 changes

except for those from_s/json issues, which I think are being fixed on  
0.25.1


--~--~-~--~~~---~--~~
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: Mac Domainname and facter

2009-09-18 Thread Allan Marcus

/Library/Ruby/Site/1.8/facter/domain.rb

I think for the Mac you need to set the search domain in the Network  
System Pref, and that is what facter uses, but I'm not sure I'm  
reading the code right.

---
Thanks,

Allan Marcus
505-667-5666



On Sep 18, 2009, at 10:11 AM, engle wrote:


 We have a large number of Macs that are using puppet to install
 packages. The source of the packages is determined by the domain name
 of the client. We are using ISC's dhcpd. The macs seem to pick up the
 correct domain name from the dhcp server but facter is not picking it
 up. If I type domainname at a shell prompt, I get nothing. However,
 when the client requests a cert from the puppet server, it is
 requested with the FQDN which is correct.

 So, where does facter get its domain name information from on the
 client. I know that Macs have a number of places where they store and
 use hostname and domainname. Which one does facter use?

 Thanks,

 -kurt
 


--~--~-~--~~~---~--~~
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: Mac Domainname and facter

2009-09-18 Thread Allan Marcus

whoops, /Library/Ruby/Site/1.8/facter/hostname.rb
also seems to play a part. The hostname command is used, then it's  
parsed with regex magic.

---
Thanks,

Allan Marcus
505-667-5666



On Sep 18, 2009, at 12:16 PM, Allan Marcus wrote:


 /Library/Ruby/Site/1.8/facter/domain.rb

 I think for the Mac you need to set the search domain in the Network
 System Pref, and that is what facter uses, but I'm not sure I'm
 reading the code right.

 ---
 Thanks,

 Allan Marcus
 505-667-5666



 On Sep 18, 2009, at 10:11 AM, engle wrote:


 We have a large number of Macs that are using puppet to install
 packages. The source of the packages is determined by the domain name
 of the client. We are using ISC's dhcpd. The macs seem to pick up the
 correct domain name from the dhcp server but facter is not picking it
 up. If I type domainname at a shell prompt, I get nothing. However,
 when the client requests a cert from the puppet server, it is
 requested with the FQDN which is correct.

 So, where does facter get its domain name information from on the
 client. I know that Macs have a number of places where they store and
 use hostname and domainname. Which one does facter use?

 Thanks,

 -kurt



 


--~--~-~--~~~---~--~~
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: Mac Domainname and facter

2009-09-18 Thread Nigel Kersten

On Fri, Sep 18, 2009 at 11:16 AM, Allan Marcus al...@lanl.gov wrote:

 /Library/Ruby/Site/1.8/facter/domain.rb

 I think for the Mac you need to set the search domain in the Network
 System Pref, and that is what facter uses, but I'm not sure I'm
 reading the code right.

No, if you're using DHCP it should fall to resolv.conf which is
automatically generated by data provided by DHCP to the interface for
the SystemConfiguration framework.

It'll try dnsdomainname first, which will fail, then domainname, which
will be empty unless you're attached to NIS, then resolv.conf

It will pick any domain entry, if that doesn't exist, then fall back
to search domains.

You should be getting exactly the same results as you see when dumping
a DHCP response with

ipconfig getpacket en1 (en0 or whatever)


OS X clients have ComputerName and LocalHostName in
SystemConfiguration as well, which are what are set via the Sharing
prefpane. These are independent of actual domain names, but the fact
that terminal prompts fall back to them in some situations often
confuses people.

scutil --get ComputerName
scutil --get LocalHostName



 ---
 Thanks,

 Allan Marcus
 505-667-5666



 On Sep 18, 2009, at 10:11 AM, engle wrote:


 We have a large number of Macs that are using puppet to install
 packages. The source of the packages is determined by the domain name
 of the client. We are using ISC's dhcpd. The macs seem to pick up the
 correct domain name from the dhcp server but facter is not picking it
 up. If I type domainname at a shell prompt, I get nothing. However,
 when the client requests a cert from the puppet server, it is
 requested with the FQDN which is correct.

 So, where does facter get its domain name information from on the
 client. I know that Macs have a number of places where they store and
 use hostname and domainname. Which one does facter use?

 Thanks,

 -kurt
 


 




-- 
Nigel Kersten
nig...@google.com
System Administrator
Google Inc.

--~--~-~--~~~---~--~~
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: Array of values for (exec) return?

2009-09-18 Thread John Ingersoll
On Fri, Sep 18, 2009 at 4:46 AM, David Schmitt da...@dasz.at wrote:


 John Ingersoll wrote:
  Hi,
 
  I have an exec {} that runs a command line script, for which 0 and 1 are
  both good return codes. (Specifically, spamassassin update; 1 means no
  new downloads). I tried
 
  returns = [0,1],

 I'm using this for sa-update, in an exec:

  /usr/bin/sa-update ; case $? in 0) /etc/init.d/spamassassin restart;; 1)
 : ;; *) echo Unknown Error; exit 1;; esac


Very good; I had overlooked the simple bash syntax that can handle that .
And I had forgotten about doing the restart when updates happen. Fortunately
it's a test box with not much happening yet.

Thanks,

-- 
John Ingersoll, Jr.

--~--~-~--~~~---~--~~
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] copying file from multiple sources

2009-09-18 Thread Luke Schierer
I am looking at migrating a set of servers from cfengine management to
puppet management.  For the most part, the move has been relatively straight
forward, and I am pleased with the way that puppet's modules have made some
of the things I did in cfengine2 much cleaner.  There is one thing though
that was relatively easy in cfengine that I am not seeing a good way to
achieve with puppet.

In cfengine I defined a variable serverlist that was essentially an array of
hostnames. I then had the following copy block

copy:
 somehost::
   /path/to/file/that/updates/nightly
 server=${serverlist}
 dest=/var/www/repository/${this}
 mode=644 owner=apache group=wheel

which caused the one host in the class somehost to copy the file from each
server in the array serverlist to the repository.
**
The closest I see in puppet would be to list each server source as a
different file entry in a class.

Something like (psuedo code)

class pullfile {
  File { ensure = file, owner = apache, group = wheel, mode = 644, }
  file {
host1: source = puppet://host1/path/to/file path =
/var/www/repository/host1;
host2: source = puppet://host2/path/to/file path =
/var/www/repository/host2;
   }
 }

and have puppetmaster on each host.

Is there a better way?

Thanks!

Luke

--~--~-~--~~~---~--~~
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] Define inside 'if'

2009-09-18 Thread Trevor Vaughan

Should I be able to put a define inside of an 'if' block?

It doesn't seem to be working in 0.24.8.

Thanks,

Trevor

--~--~-~--~~~---~--~~
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: copying file from multiple sources

2009-09-18 Thread Luke Schierer


On Sep 18, 2009, at 18:30 EDT, Disconnect wrote:


 (Wow, hi Luke! LTNT!)

Yes, it has!


 The standard way to do that is:
 source = 
 [puppet:///foo/file-$hostname,puppet:///foo/file-$lsbdistcodename 
 ,puppet:///foo/file]
 - check for modules/foo/file-www4, then file-jaunty, then file


As I understood source arrays, would only grab the first one to  
succeed, Type Reference says If you specify multiple file sources for  
a file, then the first source that exists will be used..Is that  
page out of date?

Luke



 On Fri, Sep 18, 2009 at 4:37 PM, Luke Schierer luke.schie...@gmail.com 
  wrote:
 I am looking at migrating a set of servers from cfengine management  
 to
 puppet management.  For the most part, the move has been relatively  
 straight
 forward, and I am pleased with the way that puppet's modules have  
 made some
 of the things I did in cfengine2 much cleaner.  There is one thing  
 though
 that was relatively easy in cfengine that I am not seeing a good  
 way to
 achieve with puppet.

 In cfengine I defined a variable serverlist that was essentially an  
 array of
 hostnames. I then had the following copy block

 copy:
  somehost::
/path/to/file/that/updates/nightly
  server=${serverlist}
  dest=/var/www/repository/${this}
  mode=644 owner=apache group=wheel

 which caused the one host in the class somehost to copy the file  
 from each
 server in the array serverlist to the repository.

 The closest I see in puppet would be to list each server source as a
 different file entry in a class.

 Something like (psuedo code)

 class pullfile {
   File { ensure = file, owner = apache, group = wheel, mode =  
 644, }
   file {
 host1: source = puppet://host1/path/to/file path =
 /var/www/repository/host1;
 host2: source = puppet://host2/path/to/file path =
 /var/www/repository/host2;
}
  }

 and have puppetmaster on each host.

 Is there a better way?

 Thanks!

 Luke

 


--~--~-~--~~~---~--~~
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] failing to make rrdgraph to work

2009-09-18 Thread Asif Iqbal
I am running puppet 0.24.8 on ubuntu 9.04
I am failing to make the rrdgraph to work

Sep 18 23:46:36 sys-ubuntu puppetmasterd[30748]: RRD library is missing;
cannot store metricsSep 18 23:46:36 sys-ubuntu puppetmasterd[30748]: RRD
library is missing; cannot graph metrics
Sep 18 23:46:36 sys-ubuntu puppetmasterd[30748]: RRD library is missing;
cannot store metrics
Sep 18 23:46:36 sys-ubuntu puppetmasterd[30748]: RRD library is missing;
cannot graph metrics
Sep 18 23:46:36 sys-ubuntu puppetmasterd[30748]: Report rrdgraph failed:
Could not find graphs for daily

I searched the google and found no solution, answer with a fix for ubuntu

Any help would be greatly appreciated

-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---