FAQ
I'm testing a 'cleanup' stage which runs after Stage[main] and removes a bunch of package resources.

To do this, I tried a simple check of defined(Package[<foo>]) combined with a custom facter fact (called 'app_packages'):
class app::package::cleaner {

define check_and_remove {
if !defined(Package[$title]) {
package { $title:
ensure => absent
}
}
}

$apps = split($::app_packages, ',')
check_and_remove { $apps: }

}

node 'foo' {
class { 'app::package::cleaner': stage => 'cleanup' }
}
Unfortunately, this results in a dependency cycle. It appears that putting the Package[$title] resource reference in defined() actually invokes an implicit dependency between my cleanup helper resource in the cleanup stage and the original Package resource in the main stage.
Augeas[redacted] => Service[iptables] => Class[Iptables] => Stage[main] => Stage[cleanup] => Class[App::Package::Cleaner] => App::Package::Cleaner::Check_and_remove[package-434] => Package[package-434] => Exec[app-graceful-restart] => Class[App] => Stage[main]
Is this implicit dependency expected behaviour or am I doing something Bad(tm)?

Tom

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 9 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJun 4, '13 at 6:23a
activeJun 14, '13 at 2:28p
posts9
users2
websitepuppetlabs.com

2 users in discussion

Jcbollinger: 5 posts Tom Lanyon: 4 posts

People

Translate

site design / logo © 2022 Grokbase