diff --git a/manifests/init.pp b/manifests/init.pp index 4978ae8..3eb2d4b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -28,6 +28,7 @@ $package_type = $activemq::params::package_type, $architecture_flag = $activemq::params::architecture_flag, $activemqxml_source = undef, + $activemqxml_content = undef, ) inherits activemq::params { validate_re($package_type, '^rpm$|^tarball$') @@ -35,15 +36,30 @@ if $activemqxml_source and (!$console or defined(Class['activemq::stomp'])) { fail('If you set activemqxml_source, console needs to be true and activemq::stomp must not be defined.') } + + if $activemqxml_source and $activemqxml_content { + fail('The content of the activemq configuration may only be defined as a constant file or erb template') + } if $activemqxml_source { file { "${activemq::home}/activemq/conf/activemq.xml": ensure => present, owner => $user, group => $group, + mode => '0400', source => $activemqxml_source, } } + + if $activemqxml_content { + file { "${activemq::home}/activemq/conf/activemq.xml": + ensure => present, + owner => $user, + group => $group, + mode => '0400', + content => $activemqxml_content, + } + } $wrapper = $package_type ? { 'tarball' => "${home}/activemq/bin/linux-x86-${architecture_flag}/wrapper.conf", diff --git a/templates/activemq_template.erb b/templates/activemq_template.erb new file mode 100644 index 0000000..98a780f --- /dev/null +++ b/templates/activemq_template.erb @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% if @console %> + + + <% end %> + \ No newline at end of file