Issue #6846 has been updated by Ben Hughes.

Status changed from Needs Decision to Investigating

John, can you have a look over this please, and see if this is the problem 
you're describing. I can't see the forest for the trees here I fear.

foo.pp:
<pre>
Exec{ path   => 
'/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin' }

exec{
    'cpstart':
    command => 'cp /tmp/deps/start /tmp/deps/file0',
}

file{
  '/tmp/deps/file1':
      ensure  => file,
      source  => '/tmp/deps/file0',
      require => Exec['cpstart'],
}

file{
  '/tmp/deps/file2':
      ensure  => file,
      source  => '/tmp/deps/file1',
      require => File['/tmp/deps/file1'],
}

file{
  '/tmp/deps/file3':
      ensure  => file,
      source  => '/tmp/deps/file2',
      require => File['/tmp/deps/file2'],
}

exec{
 'cp /tmp/deps/file3 /tmp/deps/finish':
     require => File['/tmp/deps/file3'],
}
</pre>

Outputs:
<pre>
[ben@Paresthesia:~]% puppet apply --noop foo.pp
notice: /Stage[main]//Exec[cpstart]/returns: current_value notrun, should be 0 
(noop)
err: /Stage[main]//File[/tmp/deps/file1]: Could not evaluate: Could not 
retrieve information from source(s) /tmp/deps/file0 at /Users/ben/foo.pp:13
notice: /Stage[main]//File[/tmp/deps/file2]: Dependency File[/tmp/deps/file1] 
has failures: true
warning: /Stage[main]//File[/tmp/deps/file2]: Skipping because of failed 
dependencies
notice: /Stage[main]//File[/tmp/deps/file3]: Dependency File[/tmp/deps/file1] 
has failures: true
warning: /Stage[main]//File[/tmp/deps/file3]: Skipping because of failed 
dependencies
notice: /Stage[main]//Exec[cp /tmp/deps/file3 /tmp/deps/finish]: Dependency 
File[/tmp/deps/file1] has failures: true
warning: /Stage[main]//Exec[cp /tmp/deps/file3 /tmp/deps/finish]: Skipping 
because of failed dependencies
notice: Finished catalog run in 0.03 seconds
[ben@Paresthesia:~]% puppet apply foo.pp       
notice: /Stage[main]//Exec[cpstart]/returns: executed successfully
notice: /Stage[main]//File[/tmp/deps/file1]/ensure: defined content as 
'{md5}d41d8cd98f00b204e9800998ecf8427e'
notice: /Stage[main]//File[/tmp/deps/file2]/ensure: defined content as 
'{md5}d41d8cd98f00b204e9800998ecf8427e'
notice: /Stage[main]//File[/tmp/deps/file3]/ensure: defined content as 
'{md5}d41d8cd98f00b204e9800998ecf8427e'
notice: /Stage[main]//Exec[cp /tmp/deps/file3 /tmp/deps/finish]/returns: 
executed successfully
notice: Finished catalog run in 0.22 seconds
</pre>

Thanks.
----------------------------------------
Feature #6846: Report full list of errors, not just the last error
https://projects.puppetlabs.com/issues/6846

Author: John Crenshaw
Status: Investigating
Priority: Low
Assignee: Nigel Kersten
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


Reproducible using the camptocamp apache module's apache::vhost-ssl method as a 
--noop on a machine that doesn't already have apache installed. (The reason in 
this case, is because apache installs a file, which is later used as a 
prerequisite for the "generate-ssl-cert-$name" event, which itself generates a 
file that is the prerequisite for the "public CSR file for $name" event. Here 
are the interesting bits of the apache::vhost-ssl define:

`
    exec { "generate-ssl-cert-$name":
      command => "/usr/local/sbin/generate-ssl-cert.sh ${name} 
${apache::params::root}/${name}/ssl/ssleay.cnf 
${apache::params::root}/${name}/ssl/ ${days}",
      creates => $csrfile,
      notify  => Exec["apache-graceful"],
      require => [
        File["${apache::params::root}/${name}/ssl/ssleay.cnf"],
        File["/usr/local/sbin/generate-ssl-cert.sh"],
      ],
    }
`

Then later on:

`
    # put a copy of the CSR in htdocs, or another location if $publish_csr
    # specifies so.
    file { "public CSR file for $name":
      ensure  => $publish_csr ? {
        false   => "absent",
        default => "present",
      },
      path    => $publish_csr ? {
        true    => "${apache::params::root}/${name}/htdocs/${name}.csr",
        false   => "${apache::params::root}/${name}/htdocs/${name}.csr",
        default => $publish_csr,
      },
      source  => "file://$csrfile",
      mode    => 640,
      seltype => "httpd_sys_content_t",
      require => Exec["generate-ssl-cert-$name"],
    }
`

This gives an error: Could not retrieve information from source(s) 
file:///var/www/example.com/ssl/example.com.csr at 
/etc/puppet/modules/apache/manifests/definitions/vhost-ssl.pp

You don't see the real error unless you remove the copying entry. The real 
error is: 
Could not find dependency File[/usr/local/sbin/generate-ssl-cert.sh] for 
Exec[generate-ssl-cert-donedesk.com] at 
/etc/puppet/modules/apache/manifests/definitions/vhost-ssl.pp:224

...which is of course caused by the dependency on a non-existent file 
(non-existent, because the noop suppressed the installation that would have 
created it, but that's a bug in the definition, not puppet.)

Puppet should have recursively indicated all of the failed dependencies, not 
just one.


-- 
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