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:
> [...]
>> ok so using --tage classname works just fine. thanks a lot. learned
>> something cool
>>
>> however, if I run the puppetd as a daemon, then I like to control this
>> from the puppetmasterd.
>>
>> 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 am using 0.24.5 in ubuntu. That seems to be latest pkg. May be I
should compile
it from source?

>
> 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": }
        }
}

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){
                group { "$title":
                        gid => "$gid",
                        ensure => present,
                }
        }
        define myuser ($uid,$gid=1,$comment,$shell,$home,$password) {
                user { $name:
                        ensure => present,
                        uid => "$uid",
                        gid => "$gid",
                        comment => "$comment",
                        shell => "/bin/bash",
                        password => "$password",
                        managehome => true,
                        home => "/export/home/$name",
                }
        }
}

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",
}

nmc::myuser { "abradley":
uid => "1025",
gid => "10",
password => "blzEZiPmJx1Y",
comment => "Alex Bradley",
home => "/home/abradley",
shell => "/bin/ksh",
}

nmc::myuser { "bobrien":
uid => "1009",
gid => "10",
password => "prg2i/aA5cPk",
comment => "Bill O'Brien",
home => "/home/bobrien",
shell => "/usr/local/bin/tcsh",
}

nmc::myuser { "bwhelton":
uid => "1045",
gid => "10",
password => "XSnR6poHGUk",
comment => "Bob Whelton",
home => "/home/bwhelton",
shell => "/usr/local/bin/bash",
}



>
> 2) You have another node spec somewhere (nodes.pp ?) that matches your
> client more closely than the default node spec, and you are getting
> the extra classes from there.

I don't have any nodes.pp file

pup...@sys-ubuntu:/etc/puppet/manifests$ ls -lR
.:
total 168
drwxr-xr-x 2 puppet puppet  4096 2009-08-11 16:06 classes
drwxr-xr-x 2 puppet puppet  4096 2009-06-29 13:01 definitions
drwxr-xr-x 3 puppet puppet  4096 2009-06-29 15:14 files
-rw-r--r-- 1 puppet puppet   459 2009-06-29 15:14 fileserver.conf
drwxr-xr-x 2 puppet puppet  4096 2009-06-29 13:01 groups
drwxr-xr-x 2 puppet puppet  4096 2009-06-29 13:01 os
-rw-r--r-- 1 puppet puppet 83326 2009-08-09 15:32 out
-rw-r--r-- 1 puppet puppet   144 2009-08-11 14:49 site.pp
drwxr-xr-x 2 puppet puppet  4096 2009-06-29 13:01 templates
-rw-r--r-- 1 puppet puppet     0 2009-07-01 12:10 templates.pp
drwxr-xr-x 2 puppet puppet  4096 2009-06-29 13:01 users

./classes:
total 32
-rw-r--r-- 1 puppet puppet  484 2009-08-11 13:41 newungrp.pp
-rw-r--r-- 1 puppet puppet  362 2009-08-11 13:45 newuthngrp.pp
-rw-r--r-- 1 puppet puppet  655 2009-08-11 14:14 nmc2.pp
-rw-r--r-- 1 puppet puppet 1532 2009-08-11 16:06 nmc-delete.pp
-rw-r--r-- 1 puppet puppet 6932 2009-08-11 16:06 nmc.pp
-rw-r--r-- 1 puppet puppet  121 2009-03-19 16:19 sudo.pp
-rw-r--r-- 1 puppet puppet  277 2009-08-07 12:19 user.pp.test

./definitions:
total 0

./files:
total 0

./groups:
total 0

./os:
total 0

./templates:
total 0

./users:
total 0


>
> 3) You are not talking to the puppetmaster you think you are talking
> to (e.g., test vs. production).

I have only puppetmaster and that is not production yet.

>
> There are surely other possibilities, but those seem the most likely
> to me.
>
>
> John
> >
>



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

Reply via email to