On Tue, Feb 15, 2011 at 2:09 PM, Daniel Pittman <[email protected]> wrote:
> On Tue, Feb 15, 2011 at 11:05, Derek J. Balling <[email protected]> wrote:
>
> […]
>> So I've got two modules, one for "random_app" and one for "dns_config".
>> "dns_config" has a file resource "resolv.conf" which is just what the name
>> implies.
>>
>> I want service 'foo' in my random_app module to subscribe to dns_config's
>> resolv.conf, and if the resolv.conf changes, to restart. (Because, it's a
>> misbehaving app who doesn't just use gethostbyname() calls, but runs its own
>> resolver and never looks at resolv.conf again after it starts up.)
>>
>> I would have thought it'd just be subscribing the service to
>> File['dns_config::resolv.conf'] but clearly that didn't work.
>
> service { "foo": require => File["/etc/resolv.conf"] }
>
> That will happily cross modules, completely ignoring that boundary.
> (Match the name of the file you give in the other module, obviously.
> :)
You can also create class level dependency so it is less tightly
coupled to a specific resource which may benefit you in the long run
should you need to refactor dns_config class.
class random_app {
require dns_config
...
}
Thanks,
Nan
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.