Issue #7486 has been updated by John Florian.

James Turnbull wrote:
> I think we're agreeing the design is flawed. :) Do you have a view on how it 
> should look?

Absolutely, having made a large commitment to it in our technology plans, I 
need to make it work to rigorous standards.  I've seen comments like:
<blockquote>
While the holy grail is for all resources to apply correctly in a single Puppet 
run, it isn't always simple to achieve this; ask yourself if it really matters 
if it takes two runs to get the desired configuration.

http://plathrop.tertiusfamily.net/puppet/best-practice-draft.html
</blockquote>

I generally don't have such luxuries.  I need puppet to bring about a certain
state on a platform the first time, every time.  By count, most of the
nodes I manage are stateless Linux systems (where all state is lost at
shutdown/reboot).  These nodes are power-cycled frequently, so you might say
I'm perpetually running unit tests.  :-)

So give me a bit and I'll be back with a vision.
----------------------------------------
Bug #7486: Service refreshed despite failed dependencies
https://projects.puppetlabs.com/issues/7486

Author: John Florian
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category: 
Target version: 
Affected Puppet version: 0.25.5
Keywords: 
Branch: 


In the following manifest, I would expect the service to not be restarted if
either File results in a failure, however that's not the case:

<pre>
# dependency-test.pp

file { "/tmp/test/xyz/A":
    content     => 'file A',
}

file { "/tmp/test/B":
    content     => 'file B',
}

service { "crond":
    enable      => true,
    ensure      => running,
    hasrestart  => true,
    hasstatus   => true,
    require     => [
        File['/tmp/test/xyz/A'],
    ],
    subscribe   => [
        File['/tmp/test/B'],
    ],
}
</pre>

Here's the results I get:

<pre>
# cd /tmp; rm -rf test; mkdir test
# service crond status; puppet -v dependency-test.pp; service crond status
crond (pid  28753) is running...
info: Applying configuration version '1305125236'
err: //File[/tmp/test/xyz/A]/content: change from absent to 
{md5}31d97c4d04593b21b399ace73b061c34 failed: No such file or directory - 
/tmp/test/xyz/A.puppettmp_7091
notice: //File[/tmp/test/B]/content: defined content as 'unknown checksum'
info: //File[/tmp/test/B]: Scheduling refresh of Service[crond]
notice: //Service[crond]: Dependency file[/tmp/test/xyz/A] has 1 failures
warning: //Service[crond]: Skipping because of failed dependencies
notice: //Service[crond]: Triggering 'refresh' from 1 dependencies
crond (pid  28937) is running...
# puppet --version
0.25.5
</pre>

File A's failure (because subdir xyz doesn't exist) is intentional here to
demonstrate how the service gets restarted despite all dependencies not being
satisfied.  My understanding is that subscribe implies a depenency.  However,
I even tried adding File B to the require clause and got the exact same
results, the service was started because File B sent a notify (as it should)
and puppet ignored the failed dependency for File A (as it should not).

I have an application in which the service absolutely must not start unless
all dependencies are satisfied.

This may be related to #5876.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to