I know how I can use resource ordering in Puppet to order built-in types (user, group, cron...) or classes, but I wonder how I can make it for specific instances of classes.
For example, I use puppetlabs/apt module and the apt::source defined type to push wheezy/updates/... apt sources. My code looks like
apt::source { 'debian_wheezy':
location => 'http://ftp.debian.org/debian/',
release => 'wheezy',
repos => 'main contrib non-free',
include_src => false,
}
apt::source { 'debian_wheezy_updates':
location => 'http://ftp.debian.org/debian/',
release => 'wheezy-updates',
repos => 'main contrib non-free',
include_src => false,
}
I want to make use of another module to configure HAProxy, but I need to define another apt::source to configure wheezy backports because haproxy is not available on the standard wheezy repository. So I want to indicate that my haproxy class depends of my apt::source type defining wheezy backports.
I have tried something naive like
Class['apt::source'] -> Class['haproxy']
but logically this does not make sense: I want to specify one specific instance of apt::source.
Do anybody knows how I can do that?
thanks
When you declare the haproxy class you can require it, e.g.:
You can put the relevant
apt::source
resource in it's own class. Example:myapt:
myapt::default:
myapt::backports:
myhaproxy: