# profiles::haproxy::peers class profiles::haproxy::peers ( Boolean $enable = false, ){ if $enable { $peer_tag = "${facts['country']}-${facts['region']}-${facts['environment']}" @@haproxy::peer { "${peer_tag}_${facts['networking']['fqdn']}": peers_name => $facts['networking']['fqdn'], port => 10000, tag => $peer_tag, } # collect exported resources Haproxy::Peer <<| tag == $peer_tag |>> haproxy::peers { $peer_tag: collect_exported => true } } }