On Aug 12, 9:53 am, Asif Iqbal <vad...@gmail.com> wrote:
> On Wed, Aug 12, 2009 at 9:03 AM, jcbollinger<john.bollin...@stjude.org> wrote:
>
> > On Aug 11, 3:13 pm, Asif Iqbal <vad...@gmail.com> wrote:

[...]

> >> Is is possible to config a resource where a node will only get a
> >> specific class and nothing else?
>
> > Puppetmasterd matches exactly one node spec to each client, using the
> > default node spec if no others match.  The classes specified by the
> > chosen node spec (and only those) are applied to that client.  That's
> > how it should be, and that's how it works for me in version 0.24.8.

> > I can think of several possible explanations for the behavior you see:
>
> > 1) Your "nmc-delete" class includes other classes, which are therefore
> > also applied to any node that gets nmc-delete.
>
> pup...@sys-ubuntu:/etc/puppet/manifests$ cat classes/nmc-delete.pp
> class nmc-delete {
>         define mygroup ($gid){
>                 group { "$title":
>                         gid => "$gid",
>                         ensure => present,
>                 }
>         }
>         define deluser {
>                 exec { "/usr/sbin/userdel $name": }
>                 exec { "/usr/bin/rm -rf /export/home/$name": }
>         }
>
> }

AHA! These resources do not belong to any class; they are top-level:

> nmc-delete::deluser { "seagate": }
> nmc-delete::deluser { "abradley": }
> nmc-delete::deluser { "bobrien": }
>
> pup...@sys-ubuntu:/etc/puppet/manifests$ cat classes/nmc.pp
> class nmc {
>         define mygroup ($gid){

[...]

>         }
>         define myuser ($uid,$gid=1,$comment,$shell,$home,$password) {

[...]

>         }
>
> }

More top-level resources:

> nmc::mygroup { "group1": gid => "70006" }
> nmc::mygroup { "group2": gid => "15" }
> nmc::mygroup { "dba": gid => "101" }
>
> nmc::myuser { "seagate":
> uid => "120",
> gid => "10",
> password => ".i0gouaHfLC2",
> comment => "",
> home => "/home/seagate",
> shell => "/bin/sh",
>
> }

[...]

As I hinted above, I think I see the problem.  If I'm reading your
manifests correctly, your resources are not in classes at all.  They
are being applied [only] because you are importing them directly into
site.pp.  I think you need to structure your code something like this:

class nmc-delete {
        define mygroup ($gid){
                group { "$title":
                        gid => "$gid",
                        ensure => present,
                }
        }
        define deluser {
                exec { "/usr/sbin/userdel $name": }
                exec { "/usr/bin/rm -rf /export/home/$name": }
        }

        deluser { "seagate": }
        deluser { "abradley": }
        deluser { "bobrien": }

}


(And similarly for your other manifests.)


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

Reply via email to