Last active
December 14, 2015 20:49
-
-
Save endzyme/5146965 to your computer and use it in GitHub Desktop.
concat use for active mq configuration file populating static clustered known hosts. -- Updated for better handling of filtering. -- This method of Exported Resources with multiple filters will require PuppetDB running.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When you build your ERB files you should split them up into header and footer around | |
# the dynamic area. Which also sucks. Wish there was a better way of getting stored | |
# configs out of puppet upon runtime.. Like maybe into variables. | |
class activemq::activemqconfig () { | |
include concat::setup | |
concat {'/usr/local/activemq/apache-activemq-5.5.1/conf/activemq.xml': | |
owner => 'activemq', | |
group => 'activemq', | |
mode => '0644', | |
#require => Package['activemq'], | |
#notify => Service['activemq'] | |
} | |
concat::fragment { 'activemq_configuration_file_header': | |
target => '/usr/local/activemq/apache-activemq-5.5.1/conf/activemq.xml', | |
order => '10', | |
content => template('activemq/activemq_header.xml.erb') | |
} | |
@@activemq::activemqbrokers { "brokerIP-${::hostname}": | |
target => '/usr/local/activemq/apache-activemq-5.5.1/conf/activemq.xml', | |
order => '20', | |
content => template('activemq/activemq_ip_list.xml.erb'), | |
tag => ["activemq_broker_${::host}","env_${::environment}"] | |
} | |
Activemq::Activemqbrokers <<| tag != "activemq_broker_${::host}" and tag == "env_${::environment}" |>> | |
concat::fragment { 'activemq_configuration_file_footer': | |
target => '/usr/local/activemq/apache-activemq-5.5.1/conf/activemq.xml', | |
order => '30', | |
content => template('activemq/activemq_footer.xml.erb') | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Abstracted to help filter out not potentially collecting all | |
# concat::fragment resources by accident. | |
define activemq::activemqbrokers ($target, $order, $content) { | |
concat::fragment {$name: | |
target => $target, | |
order => $order, | |
content => $content | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- the top of the activemq stuff --> | |
<!-- snip --> | |
<networkConnectors> | |
<networkConnector uri="static:( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssl://<%= @ipaddress %>:62001,<%# note no \n %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment