FAQ
Hello,

I'm having some trouble with subclasses accessing other subclasses within
the same main class.

I have boiled it down a general case. I have the following files:

## /etc/puppet/modules/test1
class test1 {

class {'test2::bar':}

}

## /etc/puppet/modules/test2/init.pp
class test2 {
class {test2::foo}
class {test2::bar}
class {test2::baz}
}

## /etc/puppet/modules/test2/foo.pp
class test2::foo {
# do something here in foo

}

## /etc/puppet/modules/test2/bar.pp
class test2::bar {
# do something here that requires test2::foo
exec { 'bar_in_tmp':
path => '/usr/bin:/usr/sbin:/bin',
command => "touch /tmp/bar",
creates => '/tmp/bar',
require => [
Class['test2::foo'],
],
}

}

## /etc/puppet/modules/test2/baz.pp

class test2::baz {
# do something unwanted here


}

When the agent runs it dies saying "Could not find dependence
Class['Test2::Foo'] for Exec['bar_in_tmp']"

Now if I change that line in test1 to just class {'test2':} it runs without
error. However since the main class call test2::baz, it does more than I
wanted. Am I not understanding something? How do I just do bar and foo?

Thanks in advance,

-LTH




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

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 5 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMay 17, '12 at 2:53p
activeMay 18, '12 at 1:16p
posts5
users3
websitepuppetlabs.com

3 users in discussion

LTH: 2 posts James Sweeny: 2 posts Jcbollinger: 1 post

People

Translate

site design / logo © 2022 Grokbase