You need either virtual resources or custom facts. If the configuration of one host will change the configuration of another, then you need exported resources. I have all these things, actually. Here's a sampling.
Virtual Resources
On the Monitoring class:
@file { '/path/to/apache/monitoring/conf':
ensure => file,
source => 'puppet:///modules/monitoring/apache.conf',
tag => 'apache-extras',
}
On the Apache class:
File <| tag == 'apache-extras' |>
Exec <| tag == 'apache-extras' |>
etc...
Custom Facts
Declare a fact like this, and put it in the appropriate place (see link above):
# apache2.rb
Facter.add("apache2") do
setcode do
%x{/usr/bin/test -x /etc/init.d/apache2 && /bin/echo yes || /bin/echo no}.chomp
end
end
On the Monitoring class, use:
if $apache2 == 'yes' {
# include configuration for apache
}
Exported Resources
On the Apache class, included in the Apache server:
@@exec { "config-web $fqdn":
tag => "monitoring-server",
}
On the Monitoring class, included in the Monitoring server:
<<| tag == 'monitoring-server' |>>