From 5ced64b2bcb1d5cfa258ced423604af121a600d2 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 18 Jan 2017 19:57:27 -0800 Subject: [PATCH] Wildfly >=10 support Wildfly includes these libs so we don't need to install them separately. Check what version of wildfly is being installed and only add the libs if necessary. Prepare to have a different config file for 10 Change-Id: Idc09ef9d6d7200d86daad586719c2d4f6e143f1c --- manifests/init.pp | 75 ++- ....xml.erb => wildfly-10-standalone.xml.erb} | 0 templates/wildfly-9-standalone.xml.erb | 617 ++++++++++++++++++ 3 files changed, 662 insertions(+), 30 deletions(-) rename templates/{standalone.xml.erb => wildfly-10-standalone.xml.erb} (100%) create mode 100644 templates/wildfly-9-standalone.xml.erb diff --git a/manifests/init.pp b/manifests/init.pp index 261d128..6e35d51 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -86,24 +86,6 @@ class zanata( ] } - archive { "/home/wildfly/${zanata_hibernate_file}": - ensure => present, - user => 'wildfly', - source => $zanata_hibernate_url, - extract => true, - extract_path => '/opt/wildfly/', - require => Package['unzip'], - } - - archive { "/home/wildfly/${zanata_mojarra_file}": - ensure => present, - user => 'wildfly', - source => $zanata_mojarra_url, - extract => true, - extract_path => '/opt/wildfly/', - require => Package['unzip'], - } - # The mysql driver name differs based on the version of the package. Ensure # we set it correctly when writing the standalone.xml config file below. if ($::operatingsystem == 'Ubuntu') and ($::operatingsystemrelease >= '16.04') { @@ -122,19 +104,52 @@ class zanata( ], } - file { '/opt/wildfly/standalone/configuration/standalone.xml': - ensure => present, - notify => Service['wildfly'], - owner => wildfly, - group => wildfly, - content => template('zanata/standalone.xml.erb'), - require => [ - Class['zanata::wildfly'], - Archive['/opt/wildfly/standalone/deployments/ROOT.war'], - Archive["/home/wildfly/${zanata_mojarra_file}"], - Archive["/home/wildfly/${zanata_hibernate_file}"], - ], + if (versioncmp($zanata_wildfly_version, '10.0.0') < 0) { + archive { "/home/wildfly/${zanata_hibernate_file}": + ensure => present, + user => 'wildfly', + source => $zanata_hibernate_url, + extract => true, + extract_path => '/opt/wildfly/', + require => Package['unzip'], + } + + archive { "/home/wildfly/${zanata_mojarra_file}": + ensure => present, + user => 'wildfly', + source => $zanata_mojarra_url, + extract => true, + extract_path => '/opt/wildfly/', + require => Package['unzip'], + } + + file { '/opt/wildfly/standalone/configuration/standalone.xml': + ensure => present, + notify => Service['wildfly'], + owner => wildfly, + group => wildfly, + content => template('zanata/wildfly-9-standalone.xml.erb'), + require => [ + Class['zanata::wildfly'], + Archive['/opt/wildfly/standalone/deployments/ROOT.war'], + Archive["/home/wildfly/${zanata_mojarra_file}"], + Archive["/home/wildfly/${zanata_hibernate_file}"], + ], + } + } else { + file { '/opt/wildfly/standalone/configuration/standalone.xml': + ensure => present, + notify => Service['wildfly'], + owner => wildfly, + group => wildfly, + content => template('zanata/wildfly-10-standalone.xml.erb'), + require => [ + Class['zanata::wildfly'], + Archive['/opt/wildfly/standalone/deployments/ROOT.war'], + ], + } } + } # == Define: zanata::validate_listener diff --git a/templates/standalone.xml.erb b/templates/wildfly-10-standalone.xml.erb similarity index 100% rename from templates/standalone.xml.erb rename to templates/wildfly-10-standalone.xml.erb diff --git a/templates/wildfly-9-standalone.xml.erb b/templates/wildfly-9-standalone.xml.erb new file mode 100644 index 0000000..53993d0 --- /dev/null +++ b/templates/wildfly-9-standalone.xml.erb @@ -0,0 +1,617 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + h2 + + sa + sa + + + + jdbc:mysql://<%= @mysql_host %>:<%= @mysql_port %>/zanata?characterEncoding=UTF-8 + com.mysql.jdbc.Driver + <%= @mysql_driver_name %> + + 0 + 20 + FailingConnectionOnly + + + <%= @zanata_db_username %> +<% if @zanata_db_password != '' -%> + <%= @zanata_db_password %> +<% end -%> + + + NOWARN + + + + + org.h2.jdbcx.JdbcDataSource + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + NIO + 102400 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jms.queue.DLQ + jms.queue.ExpiryQueue + 5000 + 2 + 10485760 + 2097152 + BLOCK + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + true + + + + true + + + + + + +<% if @zanata_openid_provider_url == '' -%> + +<% end -%> + +<% if @zanata_admin_users != '' -%> + +<% else -%> + +<% end -%> + + +<% if @zanata_smtp_host != '' -%> + +<% end -%> +<% if @zanata_smtp_port != '' -%> + +<% end -%> +<% if @zanata_smtp_username != '' -%> + +<% end -%> +<% if @zanata_smtp_password != '' -%> + +<% end -%> +<% if @zanata_smtp_tls != '' -%> + +<% end -%> +<% if @zanata_smtp_ssl != '' -%> + +<% end -%> + + + + + + + + + + + + + + + + + + + + + + + + + + +<% if @zanata_openid_provider_url != '' -%> + +<% end -%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<% @zanata_listeners.each do |listener| -%> +<% if listener == 'https' -%> +<% @listener_realm = ' security-realm="ApplicationRealm"' -%> +<% else -%> +<% @listener_realm = '' -%> +<% end -%> + <<%= listener %>-listener name="default.<%= listener %>" socket-binding="<%= listener %>"<%= @listener_realm %>/> +<% end -%> + + + + + + + + + + + + + + + + + + + + ${jboss.bind.address:127.0.0.1} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +