On Sat, Jan 19, 2013 at 12:03 PM, royhills <[email protected]> wrote:
> I've seen a couple of instances where a service resource has failed with
> an error because it's
> been evaluated before its corresponding package is installed. I can fix
> this by adding an explicit
> require to the service resource, or by just running puppet again, but I
> thought that there would be
> an implicit or automatic require from a service object to the associate
> service object.
>
> Here's an example class where I've seen this, although it only happens
> when I have this class
> as part of a larger overall manifest and I'm commissioning a new system.
>
> class tftp_server {
>
> package { 'tftpd-hpa':
> ensure => installed,
> }
>
> service { 'tftpd-hpa':
> ensure => running,
> enable => true,
> hasstatus => true,
> hasrestart => true,
> }
>
> file { '/srv/tftp':
> ensure => 'directory',
> owner => 'root',
> group => 'root',
> mode => '0644',
> require => Package['tftpd-hpa'],
> source => 'puppet:///modules/tftp_server/tftp',
> recurse => true,
> purge => true,
> ignore => '.svn',
> }
> }
>
> Note that there is no notify/subscribe between the file object and the
> service object. Perhaps
> that's why I get the problem?
>
> What I see is:
>
> info: Applying configuration version '1358616112'
> ...
> err: /Stage[main]/Tftp_server/Service[tftpd-hpa]: Could not evaluate:
> Could not find init script for 'tftpd-hpa'
> ...
> notice: /Stage[main]/Tftp_server/Package[tftpd-hpa]/ensure: ensure changed
> 'purged' to 'present'
> ...
>
> In http://docs.puppetlabs.com/learning/ordering.html, it says "Some of
> Puppet’s resource types will notice
> when an instance is related to other resources, and they’ll set up
> automatic dependencies", but it doesn't
> state exactly what resources this relates to. I'd expected service/package
> to be one of the examples though.
>
This is not an auto dependency. They are all documented in the resource
type document by searching autorequires:
http://docs.puppetlabs.com/references/latest/type.html
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.