[Puppet Users] Re: custom definitions require and +

2009-07-15 Thread robert.gstoehl

Seems to work so far, thanks. What happens when a $require is passed
to the definition which contains an array?

require = [ Package[wget], $require ]

My quick test (printing out $require via a notify) indicate that only
the first item of the array is included. Is there a way to merge
arrays?

On Jul 13, 7:12 pm, David Schmitt da...@dasz.at wrote:
 robert.gstoehl wrote:
  I'm trying to get the dependencies right:

  define wget($source, $options = , $unless = ) {
      include pkg::virtual_packages
      realize (Package[wget])
      exec {wget $options -O $title $source:
          path    = /usr/bin:/opt/csw/bin,
          unless  = $unless,
          timeout = 18000,
          require = Package[wget]
      }

      if $require {
          Exec [wget $options -O $title $source]{
              require + $require
          }
      }
  }

  Bombs with:

  err: Could not retrieve configuration: Parameter 'require' is already
  set on Exec[wget  -O ...  ] by wget at /etc/opt/csw/puppet/
  manifests/definitions/wget.pp:8; cannot redefine at /etc/opt/csw/
  puppet/manifests/definitions/wget.pp:14

  The docs say:

  Note that all defined types support automatically all metaparameters.
  Therefore you can pass any later used parameters like $require to a
  define, without any definition of it:

  define svn_repo($path) {
      exec {create_repo_${name}:
          command = /usr/bin/svnadmin create $path/$title,
          unless = /bin/test -d $path,
      }
      if $require {
          Exec[create_repo_${name}]{
              require + $require,
          }
      }
  }

  What am I doing wrong? Is there another way to add the require
  metaparameter to the nested exec resource?

 + is only valid when inheriting resources.

 Instead do this:

   define wget($source, $options = , $unless = ) {
       include pkg::virtual_packages
       realize (Package[wget])
       exec {wget $options -O $title $source:
           path    = /usr/bin:/opt/csw/bin,
           unless  = $unless,
           timeout = 18000,
       }
  
       if $require {
           Exec [wget $options -O $title $source]{
               require = [ Package[wget], $require ]
           }
       } else {
           Exec [wget $options -O $title $source]{
               require = [ Package[wget] ]
           }
       }
   }

 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: custom definitions require and +

2009-07-15 Thread robert.gstoehl

Hm, with --debug it seems like all the dependencies, even an array of
them, get passed to the nested exec. Voodoo :)
Thanks for your help.

On Jul 15, 9:55 am, robert.gstoehl robert.gsto...@gmail.com wrote:
 Seems to work so far, thanks. What happens when a $require is passed
 to the definition which contains an array?

 require = [ Package[wget], $require ]

 My quick test (printing out $require via a notify) indicate that only
 the first item of the array is included. Is there a way to merge
 arrays?

 On Jul 13, 7:12 pm, David Schmitt da...@dasz.at wrote:

  robert.gstoehl wrote:
   I'm trying to get the dependencies right:

   define wget($source, $options = , $unless = ) {
       include pkg::virtual_packages
       realize (Package[wget])
       exec {wget $options -O $title $source:
           path    = /usr/bin:/opt/csw/bin,
           unless  = $unless,
           timeout = 18000,
           require = Package[wget]
       }

       if $require {
           Exec [wget $options -O $title $source]{
               require + $require
           }
       }
   }

   Bombs with:

   err: Could not retrieve configuration: Parameter 'require' is already
   set on Exec[wget  -O ...  ] by wget at /etc/opt/csw/puppet/
   manifests/definitions/wget.pp:8; cannot redefine at /etc/opt/csw/
   puppet/manifests/definitions/wget.pp:14

   The docs say:

   Note that all defined types support automatically all metaparameters.
   Therefore you can pass any later used parameters like $require to a
   define, without any definition of it:

   define svn_repo($path) {
       exec {create_repo_${name}:
           command = /usr/bin/svnadmin create $path/$title,
           unless = /bin/test -d $path,
       }
       if $require {
           Exec[create_repo_${name}]{
               require + $require,
           }
       }
   }

   What am I doing wrong? Is there another way to add the require
   metaparameter to the nested exec resource?

  + is only valid when inheriting resources.

  Instead do this:

    define wget($source, $options = , $unless = ) {
        include pkg::virtual_packages
        realize (Package[wget])
        exec {wget $options -O $title $source:
            path    = /usr/bin:/opt/csw/bin,
            unless  = $unless,
            timeout = 18000,
        }
   
        if $require {
            Exec [wget $options -O $title $source]{
                require = [ Package[wget], $require ]
            }
        } else {
            Exec [wget $options -O $title $source]{
                require = [ Package[wget] ]
            }
        }
    }

  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: custom definitions require and +

2009-07-15 Thread David Schmitt

robert.gstoehl wrote:
 Seems to work so far, thanks. What happens when a $require is passed
 to the definition which contains an array?
 
 require = [ Package[wget], $require ]
 
 My quick test (printing out $require via a notify) indicate that only
 the first item of the array is included. Is there a way to merge
 arrays?

Use the append functionality of newer puppet releases:

http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#appending-to-variables


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: custom definitions require and +

2009-07-15 Thread robert.gstoehl

I'm still on 0.23.2 for some time. Planning the upgrade at the moment.

On Jul 15, 10:09 am, David Schmitt da...@dasz.at wrote:
 robert.gstoehl wrote:
  Seems to work so far, thanks. What happens when a $require is passed
  to the definition which contains an array?

  require = [ Package[wget], $require ]

  My quick test (printing out $require via a notify) indicate that only
  the first item of the array is included. Is there a way to merge
  arrays?

 Use the append functionality of newer puppet releases:

 http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#appending-...

 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] will resource noop always override puppetd

2009-07-15 Thread Dan Bode
For my use case, I have set the following in puppet.conf on the agent

[puppetd]
  noop=true

on the server, in the puppet module, I set the following:

file{/etc/puppet/puppet.conf:
noop = false,
content = template(puppet/puppet-agent.conf),
  }

I have noticed that this works, noop effects everything except the
puppet.conf file, here is some output

notice: Starting catalog run
notice: //Node[SERVER]/test/Exec[echo This is the Test Class]/returns: is
notrun, should be 0 *(noop)*
39c39
 # TEST1
---
 # TEST2
notice: //Node[SERVER]/base/puppet/File[/etc/puppet/puppet.conf]:
Filebucketed to main with sum 612edd1118e135cdd89675c1c8f981ae
notice: //Node[SERVER]/base/puppet/File[/etc/puppet/puppet.conf]/content:
content changed '{md5}612edd1118e135cdd89675c1c8f981ae' to
'{md5}14ce20b1d2499bed640a26e051a52909'
notice: Reparsing /etc/puppet/puppet.conf

My question is:

Is this intended behavior, will this be supported in future versions, or
will this be likely to break.

regards,

Dan

--~--~-~--~~~---~--~~
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: custom definitions require and +

2009-07-15 Thread Peter Meier

Hi

 I'm still on 0.23.2 for some time. Planning the upgrade at the moment.

then it might be worth witing for 0.25.0 imho...

cheers pete

--~--~-~--~~~---~--~~
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: executing some code with subscribe/notify/unless

2009-07-15 Thread David Schmitt

Arnau Bria wrote:
 Hi all,
 
 I have some code to execute that depends on two things:
 
 1.-) some file is modified
 
 2.-) its log shows some error.
 
 So I'd like to define both conditions, and I've done it like:
 
  file { file1:
 recurse = true,
 owner   = root,
 group   = root,
 mode= 700,
 source  = puppet://server/file1,
 notify   = Exec[refresh_conf],
 }
 
 
  exec { refresh_conf:
 command = exec something,
 #subscribe   = File[file1],
 timeout = -1,
   #unless = condition1,
 }
 
 So now I have subscribe and unless commented. subscribe because I added
 notify on file1, and unless cause if file1 notifies to refresh it
 evaluates conditon1 and,as log is fine, the exec is not refreshed.
 
 So, how may I tell refresh_conf to execute itself depending in those two
 conditions?
 
Have you tried setting the refreshonly parameter on the Exec?


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: will resource noop always override puppetd

2009-07-15 Thread David Schmitt

Dan Bode wrote:
[noop on resource overrides global noop setting]
 Is this intended behavior, will this be supported in future versions, or 
 will this be likely to break.

The UPGRADE document for 0.24.3 says this:

 Downloading plugins and facts now ignores noop. Note that this
 changes  the behaviour of a resource's noop setting. The resources noop
  setting will now alway override the global setting (previously,
  whichever was true would win).

from http://reductivelabs.com/trac/puppet/wiki/UPGRADE#id16


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: ssh_authorized_key completely ignoring require

2009-07-15 Thread Chris Blumentritt
I have run into this problem today trying to stand up some new servers.

On Tue, Apr 21, 2009 at 11:44 PM, Andrew Shafer and...@reductivelabs.comwrote:


 Scott,

 Can you pastie the simplest code to reproduce and maybe attach the files
 created by --graph to see what the relationships look like.

 Is anyone else seeing a problem like this?





 On Tue, Apr 21, 2009 at 9:02 PM, Scott scott...@gmail.com wrote:


 Hi, so I'm running into a problem since upgrading to 0.24.8 where
 puppet is trying to create an authorized key for users that don't
 exist because it doesn't do the require ( require = /etc/passwd )
 first.

 I've tried making the require a default parameter for
 ssh_autohrized_key (yes, in the same scope), I've tried making the
 passwd file a requirement for every ssh_authorized_key and I've
 tried to use before with the passwd resource ( before = Class
 [ users::ssh_keys ] ) and yet puppet insists on trying to create the
 key before doing any of the prerequisites.

 One other note, the ssh_authorized_key isn't always for the same
 person, so it's not a particular key that's causing the problem.
 Also, this was never a problem with 0.24.7.

 Cheers,
 Scott



 


--~--~-~--~~~---~--~~
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: executing some code with subscribe/notify/unless

2009-07-15 Thread Arnau Bria

On Wed, 15 Jul 2009 15:43:37 +0200
David Schmitt wrote:

Hi David,

 Have you tried setting the refreshonly parameter on the Exec?
yes I did, but, IIRC, my problem is still there, cause it evaluates the
unless and nothing is done as log is clear.

file's notify does its work, but I don't see how to add my second
condition (if log has errors) to code...

 Regards, DavidS
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] Re: will resource noop always override puppetd

2009-07-15 Thread Nigel Kersten

On Wed, Jul 15, 2009 at 7:35 AM, David Schmittda...@dasz.at wrote:

 Dan Bode wrote:
 [noop on resource overrides global noop setting]
 Is this intended behavior, will this be supported in future versions, or
 will this be likely to break.

 The UPGRADE document for 0.24.3 says this:

 Downloading plugins and facts now ignores noop. Note that this
 changes  the behaviour of a resource's noop setting. The resources noop
   setting will now alway override the global setting (previously,
   whichever was true would win).

 from http://reductivelabs.com/trac/puppet/wiki/UPGRADE#id16


This isn't true for factsync or pluginsync though.


root# puppetd --version
0.24.8
root# rm -Rf /var/lib/puppet/facts/*
root# rm -Rf /var/lib/puppet/lib/*
root# puppetd -t --factsync --pluginsync --noop
info: Retrieving plugins
notice: /File[/var/puppet/lib]/checksum: checksum changed '{mtime}Wed
Jun 17 11:29:46 -0700 2009' to '{mtime}Wed Jul 15 08:05:11 -0700 2009'
notice: /File[/var/puppet/lib/provider]/ensure: created
[...]
info: Retrieving facts
notice: /File[/var/puppet/facts]/checksum: checksum changed
'{mtime}Tue Jul 14 09:33:23 -0700 2009' to '{mtime}Wed Jul 15 08:05:08
-0700 2009'
[...]


and I've yet to get any reliable working method going for facts and
plugins in modules with environments that doesn't rely upon
factsync/pluginsync.





 Regards, DavidS

 




-- 
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: will resource noop always override puppetd

2009-07-15 Thread Dan Bode
thanks David,

At least this feature was implemented for a good reason (even though I wish
they would add certificates to that list:)

It seems reasonable to assume that this feature will not break in the
future.

On Wed, Jul 15, 2009 at 4:35 PM, David Schmitt da...@dasz.at wrote:


 Dan Bode wrote:
 [noop on resource overrides global noop setting]
  Is this intended behavior, will this be supported in future versions, or
  will this be likely to break.

 The UPGRADE document for 0.24.3 says this:

  Downloading plugins and facts now ignores noop. Note that this
  changes  the behaviour of a resource's noop setting. The resources noop
   setting will now alway override the global setting (previously,
   whichever was true would win).

 from http://reductivelabs.com/trac/puppet/wiki/UPGRADE#id16


 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: crontab and mailto

2009-07-15 Thread jcbollinger


On Jul 15, 4:05 am, Rupert linux...@googlemail.com wrote:
 is there a way to specify a mailto directive for a block of cronjobs?
 Right now I have the same email address in 4 cronjobs, i would like to
 defide that address only on the beginning fo such block.

I'm not clear on how you're specifying an e-mail address now, because
the built in Cron resource does not have a property for it.  If you
are using the 'environment' property then I think you can define a
property default within an enclosing scope:

class cronjobs {
Cron { environment = mailto...@mymail.com }

cron { mycommand:
command = /usr/local/bin/mycommand,
hour = 3,
}

cron { yourcommand:
command = /usr/local/bin/yourcommand,
hour = 4,
}
}

If that works for you then I don't think you can do better.

--~--~-~--~~~---~--~~
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] Puppet meet Uup July 29th NYC 7p

2009-07-15 Thread Larry Ludwig

Hi All

We are scheduling a NYC Puppet Meet Up.

--~--~-~--~~~---~--~~
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] Puppet User Group July 29th NYC 7p

2009-07-15 Thread Larry Ludwig

Hi All

We are scheduling a NYC Puppet User Group on July 29th in NYC at 7pm.
Location to be determined.  If anyone is interested in donating space
please let me know.  We may have some formal discussions and open to
any topics you want discussed.

If attending, reply to this thread.

-L
Larry Ludwig

--~--~-~--~~~---~--~~
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: Puppet meet Uup July 29th NYC 7p

2009-07-15 Thread Burkholder, Peter

Anyone interested in a DC meet up?  Could someone cross post to
puppet-dev?  I could probably organize at my workplace offices @ Gallery
Place metro.

-Peter 

 -Original Message-
 From: puppet-users@googlegroups.com 
 [mailto:puppet-us...@googlegroups.com] On Behalf Of Larry Ludwig
 Sent: Wednesday, July 15, 2009 1:00 PM
 To: puppet-nyc
 Cc: puppet-users@googlegroups.com
 Subject: [Puppet Users] Puppet meet Uup July 29th NYC 7p
 
 
 Hi All
 
 We are scheduling a NYC Puppet Meet Up.
 
  
 

--~--~-~--~~~---~--~~
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] puppet recipes

2009-07-15 Thread Asif Iqbal

Hi

I am looking for recipe or some hints to a recipe that can help me
achieve the following

I have about 300 servers of different functions. To make it easy I
decided to keep multiple group dirs based on the
function and have hosts,passwd,users,sudoers file located inside those
function dirs, like the following. In this
example dns is the function of the hosts listed w/ fqdn in the hosts
file. The passwd and shadow are going to be
same as the /etc/passwd and /etc/shadow file for all these hosts, same
for sudeors.  users is list of users. may have no purpose
right now.

(root)@puppetmaster:/path/to/groups# ls -lR dns/
dns/:
total 11
-rw---1 root other   1 Aug 23  2005 hosts
-r--r--r--1 root other  33 Aug 22  2005 passwd
-r1 root other  31 Aug 22  2005 shadow
-r--r-1 root root  546 Aug 27  2005 sudoers
-rw-r--r--1 root other 152 Feb 21  2006 users


currently, I have a test site.pp like this

# site.pp

node basenode {
case $hostname {
puppet-test: {}
default: {}
}
}

node 'puppet-test' {
include dns
include sudo
}

class dns_users {
@user { testuser:
ensure = present,
uid = 102,
gid = 1,
comment = test user,
home = /home/testuser,
shell = /bin/bash,
managehome = true,
}
}

class dns {
include dns_users
realize(
User[testuser]
)
}

class sudo {
file { sudoers: # a common title for all platforms
path = $operatingsystem ? {
solaris = /opt/csw/etc/sudoers,
default = /etc/sudoers
},
owner = root,
group = root,
mode = 440,
source = puppet:///sudo/sudoers
}
}

Instead of creating 300 manifests and that many more users in the
class and/or @users I like to see if there is maybe a template can be
created.
So when the puppet client comes to puppetmaster, based on the fqdn of
the host it will be assigned as part of a group. Then based on the
assigned
group it will receive specific sudoers file and a list of users will
be created based on the values in passwd and shadow files.

Looking for recipe to achieve that.

Thanks

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



[Puppet Users] Re: puppet recipes

2009-07-15 Thread Teyo Tyree
Hey Asif,

On Wed, Jul 15, 2009 at 12:51 PM, Asif Iqbal vad...@gmail.com wrote:


 Hi

 I am looking for recipe or some hints to a recipe that can help me
 achieve the following

 I have about 300 servers of different functions. To make it easy I
 decided to keep multiple group dirs based on the
 function and have hosts,passwd,users,sudoers file located inside those
 function dirs, like the following.


What do you mean by group dirs in this context? I am assuming you me host
groups base on node function.  For clarity, I will call them functional
groups.


In this
 example dns is the function of the hosts listed w/ fqdn in the hosts
 file. The passwd and shadow are going to be
 same as the /etc/passwd and /etc/shadow file for all these hosts, same
 for sudeors.  users is list of users. may have no purpose
 right now.


So, we are talking about a dns functional group based on the FQDN.  In
general, I avoid using metadata in the FQDN as a means to classify a given
node.  Classification is a human assignment, so I just classify using my
node tool (site.pp or external) as the database instead of some conditional
statement base on FQDN.  I know this is unorthodox, but I have good reason
for despising metadata based hostnames. ( Hostnames make a sorry
database! Rant available upon request. )

Secondly,  just for a simplification you can use a single sudoers file for
all of your host.  You can specify access based on host groups in the
sudoers file itself.  There are some cases (security domains) where you may
want to avoid this, but in general I use one sudoers to rule them all.

(root)@puppetmaster:/path/to/groups# ls -lR dns/
 dns/:
 total 11
 -rw---1 root other   1 Aug 23  2005 hosts
 -r--r--r--1 root other  33 Aug 22  2005 passwd
 -r1 root other  31 Aug 22  2005 shadow
 -r--r-1 root root  546 Aug 27  2005 sudoers
 -rw-r--r--1 root other 152 Feb 21  2006 users


Ok, here is the Puppety part and it is really about organization and reuse.
 Forget this host group organizational structure.  It is going to be nothing
but trouble in the long run.  Lets think of classes instead as a way to
specify configurations via composition and inheritance and lets use modules
exclusively.  Explicitly lets create two module paths:

/path/to/modules/dist:

Is where you will build small reusable modules that will be used to compose
class that classify your services. And...

/path/to/modules/site

is where you will build larger modules and create complex composite
configurations.  Here you will include classes from the dist path. I would
avoid including site classes in the classes defined in the dist path.  I
like to have the dependencies flow one way.

Ok, so in the site module path lets create a module called acme.  And
reorganize based on this structure:

/path/to/modules/site/acme


 currently, I have a test site.pp like this

 # site.pp

 node basenode {
case $hostname {
puppet-test: {}
default: {}
}
 }


K,  I would avoid doing the condition stuff here.   Instead if we have a
node foo lets just assign it the base class acme from our acme module.  This
will make our site.pp compatible with an external nodes tool.

node foo { acme: }

On a side note, no need for client server when if we are testing.  Just
checkout the dev branch of your puppet modules on the test node, use the
puppet executable and pass it a test.pp that includes the classes that you
want to test like so:

puppet --debug --modulepath=/path/to/modules/dist:/path/to/modules/site
test.pp

This is how I training people to develop their puppet code in our classes.
 Try it; you'll like it!

Alright, so here we go refactoring this we would have a acme::dns class in
our acme module that would include or inherit all the smaller classes that
are needed to setup a DNS host.


 node 'puppet-test' {
include dns
include sudo
}


So our node definition would now look like...

node 'puppet-test.fqdn.org' { include acme::dns }

Again, I prefer simple assignment.  Essentially, one class included per
node.  I do all the specification that is role based in classes.  If an
individual host needs specific parameters set, I either handle that
logically inside the classes or assign parameters to the host (External
Nodes supports this better).  This allows me to test composite classes as
part of the module development process.

We would refactor this class then:


 class dns_users {
@user { testuser:
ensure = present,
uid = 102,
gid = 1,
comment = test user,
home = /home/testuser,
shell = /bin/bash,
managehome = true,
}
 }


Becoming a single virtusers class:

class acme::virtusers {
@user{
testuser:
ensure = present,
uid = 102,

[Puppet Users] Re: Puppet User Group July 29th NYC 7p

2009-07-15 Thread Teyo Tyree
On Wed, Jul 15, 2009 at 10:03 AM, Larry Ludwig larry...@gmail.com wrote:


 Hi All

 We are scheduling a NYC Puppet User Group on July 29th in NYC at 7pm.
 Location to be determined.  If anyone is interested in donating space
 please let me know.  We may have some formal discussions and open to
 any topics you want discussed.

 If attending, reply to this thread.


I will definitely be there.  Going to be in town providing Puppet training
to the masses.


 -L
 Larry Ludwig

 

Cheers,
Teyo

-- 
Teyo Tyree :: www.reductivelabs.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
-~--~~~~--~~--~--~---



[Puppet Users] Re: Puppet User Group July 29th NYC 7p

2009-07-15 Thread Larry Ludwig

On Jul 15, 2009, at 5:48 PM, Teyo Tyree wrote:


 I will definitely be there.  Going to be in town providing Puppet  
 training to the masses.


Don't you mean spreading the gospel? :-)

-L


 Cheers,
 Teyo

 -- 
 Teyo Tyree :: www.reductivelabs.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
-~--~~~~--~~--~--~---



[Puppet Users] simple failure on service{ensure=false}

2009-07-15 Thread Fernando Padilla

I'm just starting to learn puppet, and I'm using the lates ubuntu jaunty 
image on ec2.

I noticed a random service that I wanted to shutdown so I added this:

class no_avahi {
   service { avahi-daemon:
  ensure = false
   }
}

And it sort-of worked, except this is what happened on the client:

Jul 16 05:32:56 domU-12-31-39-00-85-68 puppetd[4101]: 
(//Node[default]/no_avahi/Service[avahi-daemon]/ensure) change from 
running to stopped failed: Could not stop Service[avahi-daemon]: 
Execution of '/etc/init.d/avahi-daemon onestop' returned 1:  at 
/etc/puppet/manifests/site.pp:30


It tried to run '/etc/init.d/avahi-daemon onestop', which looks like is 
invalid for most scripts under init.d (it should be simply 'stop', not 
'onestop').



I have fixed it in my site.pp by adding my own stop command (stop = 
/etc/init.d/avahi-daemon stop), but I was just expecting puppet to 
simply work..
why is it confused in this instance?
can we file a bug report?
is it my ubuntu image is not standard?  Or puppet just confused somehow?

--~--~-~--~~~---~--~~
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: simple failure on service{ensure=false}

2009-07-15 Thread Fernando Padilla

I just saw this in the logs.. maybe it's a clue.

Jul 16 05:47:34 (none) puppetd[11187]: Found multiple default providers
for service: freebsd, debian; using freebsd

I might have to force the platform somehow to be debian or ubuntu??



Fernando Padilla wrote:
 I'm just starting to learn puppet, and I'm using the lates ubuntu jaunty 
 image on ec2.
 
 I noticed a random service that I wanted to shutdown so I added this:
 
 class no_avahi {
service { avahi-daemon:
 ensure = false
}
 }
 
 And it sort-of worked, except this is what happened on the client:
 
 Jul 16 05:32:56 domU-12-31-39-00-85-68 puppetd[4101]: 
 (//Node[default]/no_avahi/Service[avahi-daemon]/ensure) change from 
 running to stopped failed: Could not stop Service[avahi-daemon]: 
 Execution of '/etc/init.d/avahi-daemon onestop' returned 1:  at 
 /etc/puppet/manifests/site.pp:30
 
 
 It tried to run '/etc/init.d/avahi-daemon onestop', which looks like is 
 invalid for most scripts under init.d (it should be simply 'stop', not 
 'onestop').
 
 
 
 I have fixed it in my site.pp by adding my own stop command (stop = 
 /etc/init.d/avahi-daemon stop), but I was just expecting puppet to 
 simply work..
 why is it confused in this instance?
 can we file a bug report?
 is it my ubuntu image is not standard?  Or puppet just confused somehow?
 
  

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