all classes applied to every node

29 views
Skip to first unread message

Zach

unread,
Jul 11, 2011, 11:52:33 AM7/11/11
to Puppet Users
Hi all,

I'm noticing that all classes I have created are being applied to
every node, even ones that don't specifically "include" them. There
is no inheritance occurring that would allow this to happen. I've
been reading docs and couldn't find anything about this... Am I
missing something obvious? Let me know if you need more info


# puppetd --version
2.6.8

# puppetmasterd --version
2.6.8

# gem list

*** LOCAL GEMS ***

actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.3.5, 2.2.2)
activeresource (2.2.2)
activesupport (2.3.5, 2.2.2)
json (1.5.3)
mime-types (1.16)
rails (2.2.2)
rake (0.8.7)
rest-client (1.6.3)
sqlite3-ruby (1.2.4)


# ruby -v
ruby 1.8.5 (2006-08-25) [x86_64-linux]

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.6 (Tikanga)

Denmat

unread,
Jul 11, 2011, 5:11:29 PM7/11/11
to puppet...@googlegroups.com
Hi,

Sounds like they are being included somewhere in your manifest.

I've had similar issues when one of my tests was failing, eg:

if $something { include someclass }
else { include otherclass }

You can try to look at the --graph option to see if that helps track it down. See the FAQ for more on this.

Cheers,
Den

> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>

jcbollinger

unread,
Jul 12, 2011, 9:21:55 AM7/12/11
to Puppet Users


On Jul 11, 10:52 am, Zach <zachary.g.armstr...@gmail.com> wrote:
> Hi all,
>
> I'm noticing that all classes I have created are being applied to
> every node, even ones that don't specifically "include" them.  There
> is no inheritance occurring that would allow this to happen.  I've
> been reading docs and couldn't find anything about this...  Am I
> missing something obvious?   Let me know if you need more info


The problem is far more likely to be in your manifests than to be in
Puppet, but without seeing the manifests we can only speculate. My
best guess is that you have top-level "include" statements in one or
more of your manifests, perhaps where you meant "import" instead. It
may also be that some of your classes are including others, with the
result that all classes get pulled in even though some are not
explicitly included at node level.


John

Zach

unread,
Jul 12, 2011, 9:56:56 AM7/12/11
to Puppet Users
You guys got me on the right track... Turns out I was running into
this:

"One of THE MOST DIFFICULT concepts to understand for puppet newbies
is that these two things are identical:

include foo
class { 'foo': }"

In my case, I was declaring things like:
class { "nagios::webserver": stage => post }
at the very top of the site.pp

Is there a better way to declare what stage a class belongs to within
the class declaration itself?

Right now, I am doing something like this:

node webserver01...12 inherits default {
class { "nagios::webserver": stage => post }
include apache::apache_security
include apache::php_security
include apache::apache_conf_webserver
}

It's pretty ugly to have to keep declaring the stage in every node
group (I have webservers, app servers, etc)

Jacob Helwig

unread,
Jul 12, 2011, 11:06:53 AM7/12/11
to Puppet Users
Zach <zachary.g...@gmail.com> wrote:
-- 
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


You should be able to set the default stage just like any other parameter. Jesse and I fixed that a while back. Forget which version it's fixed in though.
--
Sent from my phone. Please excuse my brevity.
Reply all
Reply to author
Forward
0 new messages