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} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +