Issue #3873 has been updated by Mike Pountney.
I can confirm that this is still current at 0.25.5, and caused a dep-cycle in
our manifests that did not exist at 0.24.7.
exec {"initdb": unless => "test -d /var/lib/postgresql/data"; before =>
File["/var/lib/postgresql/data"] }
file {"/var/lib/postgresql/data": ensure => directory, mode => 0750, owner =>
postgres" }
.. created a dep-cycle on /var/lib/postgresql/data.
Workaround was to change the unless test to point to an unmanaged resource, eg:
exec {"initdb": unless => "test -f /var/lib/postgresql/data/PG_VERSION"; before
=> File["/var/lib/postgresql/data"] }
... but this is not going to be possible in every instance.
----------------------------------------
Bug #3873: Unexpected dependency created by exec
http://projects.puppetlabs.com/issues/3873
Author: Ben Beuchler
Status: Accepted
Priority: Normal
Assigned to:
Category: RAL
Target version:
Affected version: 0.25.4
Keywords:
Branch:
It looks like the Exec type is automatically creating dependencies on any files
mentioned in the "onlyif" and "unless" parameters. While I understand that
this is likely to be the most commonly desired behavior, it can unexpectedly
break things. As an example, this is the code that triggered the behavior for
me:
<pre>
class syslog-ng::weblogger inherits syslog-ng {
$alp = "/var/spool/apache2/access_log_pipe"
file { "/var/spool/apache2":
ensure => directory,
owner => www-data,
group => www-data
}
File["/etc/syslog-ng/syslog-ng.conf"] {
require => File[ "$alp" ]
}
# If apache started first and created $alp as a normal file, delete
# it.
exec { "cleanup_alp":
command => "/bin/rm ${alp}",
unless => "/usr/bin/test -p ${alp}",
}
# If the FIFO doesn't exist, create it.
exec { "access_log_pipe":
command => "/usr/bin/mkfifo ${alp}",
unless => "/usr/bin/test -p ${alp}",
require => Exec["cleanup_alp"],
}
# Ensure permissions are correct on the pipe.
file { "$alp":
ensure => present,
owner => www-data,
group => www-data,
mode => 0770,
require => Exec["access_log_pipe"]
}
}
</pre>
I'll attach the relevant section of the `--graph` output. Note the unrequested
dependency between `Exec[cleanup_alp]` and
`File[/var/spool/apache2/access_log_pipe]`.
Filing this as a bug as suggested by Dan Bode:
http://groups.google.com/group/puppet-users/browse_thread/thread/73a98af374c3f7f2
--
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.