diff --git a/manifests/init.pp b/manifests/init.pp
index bf6a3db..9ceb39b 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -20,24 +20,17 @@ class zanata(
$zanata_db_password,
$mysql_host = 'localhost',
$mysql_port = '3306',
+ $zanata_main_version = 3,
$zanata_db_name = 'zanata',
$zanata_db_username = 'zanata',
- # For wildfly < 10 the zanata_url below is expected to be a url to a built
- # war for wildfly >=10 the expectation is that it is the url to one of the
- # published zipfiles that can be overlaid atop the wildfly installation
- # dir.
- $zanata_wildfly_version = '9.0.1',
- $zanata_wildfly_install_url = 'https://repo1.maven.org/maven2/org/wildfly/wildfly-dist/9.0.1.Final/wildfly-dist-9.0.1.Final.tar.gz',
+ $zanata_wildfly_version = '10.1.0',
+ $zanata_wildfly_install_url = 'https://repo1.maven.org/maven2/org/wildfly/wildfly-dist/10.1.0.Final/wildfly-dist-10.1.0.Final.tar.gz',
- $zanata_hibernate_url = 'https://sourceforge.net/projects/zanata/files/wildfly/wildfly-8.1.0.Final-module-hibernate-main-4.2.15.Final.zip',
- $zanata_mojarra_url = 'https://sourceforge.net/projects/zanata/files/wildfly/wildfly-8.1.0.Final-module-mojarra-2.1.28.zip',
- # The default here is to a war file and can be used with wildfly < 10.
- # If using wildfly >= 10 an example url would be:
- # https://github.com/zanata/zanata-server/releases/download/server-3.9.6/zanata-3.9.6-wildfly.zip
- $zanata_url = 'https://sourceforge.net/projects/zanata/files/webapp/zanata-war-3.7.3.war',
+ $zanata_url = 'https://github.com/zanata/zanata-server/releases/download/server-3.9.6/zanata-3.9.6-wildfly.zip',
+ # newer repo,e.g. https://github.com/zanata/zanata-platform/releases/download/platform-4.2.1/zanata-4.2.1-wildfly.zip
# This should be a sha1 of whatever file is hosted at the url above.
- $zanata_checksum = '59f1ac35cce46ba4e46b06a239cd7ab4e10b5528',
+ $zanata_checksum = 'cb7a477f46a118a337b59b9f4004ef7e6c77a1a8',
$zanata_storage_dir = '/home/wildfly/zanata',
@@ -58,8 +51,6 @@ class zanata(
$zanata_file = inline_template('<%= File.basename(@zanata_url) %>')
$zanata_ext = inline_template('<%= File.extname(@zanata_url) %>')
$wildfly_file = inline_template('<%= File.basename(@zanata_wildfly_install_url) %>')
- $zanata_hibernate_file = inline_template('<%= File.basename(@zanata_hibernate_url) %>')
- $zanata_mojarra_file = inline_template('<%= File.basename(@zanata_mojarra_url) %>')
class { '::zanata::wildfly':
wildfly_version => $zanata_wildfly_version,
@@ -77,79 +68,7 @@ class zanata(
}
include '::archive'
- if ($zanata_ext == '.war') {
- # This implies the old wildfly <10 install method of installing wildfly
- # then manually injecting deps and the war into the wildfly install.
- # You need to make sure you provide a .war file url for zanata when
- # using wildfly < 10.
- package { 'libmysql-java':
- ensure => present,
- }
-
- # 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.
- # Note that this isn't the name used by files on disk, rather it is some
- # java class lookup name used in the standalone.xml configuration file.
- if ($::operatingsystem == 'Ubuntu') and ($::operatingsystemrelease >= '16.04') {
- $mysql_driver_name = 'mysql-connector-java.jar_com.mysql.jdbc.Driver_5_1'
- }
- else {
- $mysql_driver_name = 'mysql-connector-java.jar'
- }
-
- file { '/opt/wildfly/standalone/deployments/mysql-connector-java.jar':
- ensure => 'link',
- target => '/usr/share/java/mysql-connector-java.jar',
- require => [
- Package['libmysql-java'],
- Class['zanata::wildfly'],
- ],
- }
-
- archive { '/opt/wildfly/standalone/deployments/ROOT.war':
- ensure => present,
- user => 'wildfly',
- source => $zanata_url,
- checksum_type => 'sha1',
- checksum => $zanata_checksum,
- require => [
- Class['wildfly::install'],
- ]
- }
-
- 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}"],
- ],
- }
- }
- elsif ($zanata_ext == '.zip') {
+ if ($zanata_ext == '.zip') {
# This implies the newer wildfly >= 10 install method where we install
# wildfly, then unpack the zanata zip file into that install dir which
# gives us all of our deps. You need to make sure you provide a .zip file
@@ -180,7 +99,6 @@ class zanata(
require => Archive["/tmp/${zanata_file}"],
}
- # TODO make this handle wildfly >= 10.
file { '/opt/wildfly/standalone/configuration/standalone.xml':
ensure => present,
notify => Service['wildfly'],
@@ -195,7 +113,7 @@ class zanata(
}
}
else {
- fail('zanata_url must be for a .war or .zip file.')
+ fail('zanata_url must be for a .zip file.')
}
}
diff --git a/manifests/wildfly.pp b/manifests/wildfly.pp
index 67047bb..e1bd7fc 100644
--- a/manifests/wildfly.pp
+++ b/manifests/wildfly.pp
@@ -15,8 +15,8 @@
# == Class: zanata::wildfly
#
class zanata::wildfly(
- $wildfly_version = '9.0.1',
- $wildfly_install_source = 'https://repo1.maven.org/maven2/org/wildfly/wildfly-dist/9.0.1.Final/wildfly-dist-9.0.1.Final.tar.gz',
+ $wildfly_version = '10.1.0',
+ $wildfly_install_source = 'https://repo1.maven.org/maven2/org/wildfly/wildfly-dist/10.1.0.Final/wildfly-dist-10.1.0.Final.tar.gz',
) {
$javahome = '/usr/lib/jvm/default-java/jre/'
diff --git a/templates/wildfly-10-standalone.xml.erb b/templates/wildfly-10-standalone.xml.erb
index 7a1cb99..1916163 100644
--- a/templates/wildfly-10-standalone.xml.erb
+++ b/templates/wildfly-10-standalone.xml.erb
@@ -32,15 +32,45 @@
-
+<% if @zanata_main_version.to_i < 4 -%>
+<% else -%>
+
+
+
+
+
+<% 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 -%>
+<% end -%>
-
-
@@ -455,6 +485,7 @@
+<% if @zanata_main_version.to_i < 4 -%>
<% if @zanata_openid_provider_url == '' -%>
<% end -%>
@@ -484,6 +515,8 @@
<% if @zanata_smtp_ssl != '' -%>
<% end -%>
+<% end -%>
+
diff --git a/templates/wildfly-9-standalone.xml.erb b/templates/wildfly-9-standalone.xml.erb
deleted file mode 100644
index 53993d0..0000000
--- a/templates/wildfly-9-standalone.xml.erb
+++ /dev/null
@@ -1,617 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-