-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compatibility enhancement and modularization, tested on Ubuntu 16.04 …
…with WildFly 10 refers to issue #73
- Loading branch information
Suszyński Krzysztof
committed
Jun 22, 2016
1 parent
1c7f2e0
commit 5d14ea5
Showing
7 changed files
with
167 additions
and
30 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# == Class: jboss::internal::compatibility::as | ||
# This is internal class to resolve JBoss AS compatibility | ||
class jboss::internal::compatibility::as { | ||
include jboss | ||
|
||
if versioncmp($jboss::version, '7.0.0') < 0 or versioncmp($jboss::version, '8.0.0') >= 0 { | ||
fail("Unsupported version ${jboss::product} ${jboss::version}. Supporting only: JBoss AS 7.x series") | ||
} | ||
$systemd_file = undef | ||
$systemd_launcher = undef | ||
$initsystem = 'SystemV' | ||
$controller_port = '9999' | ||
$product_short = 'jboss' | ||
$initd_file = $jboss::runasdomain ? { | ||
true => "${jboss::home}/bin/init.d/jboss-as-domain.sh", | ||
default => "${jboss::home}/bin/init.d/jboss-as-standalone.sh", | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# == Class: jboss::internal::compatibility::common | ||
# This is internal class to resolve common compatibility variables | ||
class jboss::internal::compatibility::common { | ||
$osfamily_down = downcase($::osfamily) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# == Class: jboss::internal::compatibility::eap | ||
# This is internal class to resolve JBoss EAP compatibility | ||
class jboss::internal::compatibility::eap { | ||
include jboss | ||
|
||
if versioncmp($jboss::version, '6.0.0') < 0 or versioncmp($jboss::version, '8.0.0') >= 0 { | ||
fail("Unsupported version ${jboss::product} ${jboss::version}. Supporting only: JBoss EAP 6.x and 7.x series") | ||
} | ||
|
||
$systemd_file = undef | ||
$systemd_launcher = undef | ||
$initsystem = 'SystemV' | ||
|
||
$_eap_after7x = ( versioncmp($jboss::version, '7.0.0') >= 0 ) | ||
if $_eap_after7x and $::osfamily != 'RedHat' { | ||
fail("Jboss EAP 7.x is supported only on RHEL systems, but tried on ${::osfamily}!") | ||
} | ||
$initsystem = 'SystemV' | ||
$product_short = 'jboss' | ||
if $_eap_after7x { | ||
# after EAP 7.x | ||
$controller_port = '9990' | ||
$initd_file = "${jboss::home}/bin/init.d/jboss-eap-rhel.sh" | ||
} else { | ||
# before EAP 7.x | ||
$controller_port = '9999' | ||
$initd_file = $jboss::runasdomain ? { | ||
true => "${jboss::home}/bin/init.d/jboss-as-domain.sh", | ||
default => "${jboss::home}/bin/init.d/jboss-as-standalone.sh", | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# == Class: jboss::internal::compatibility::wildfly | ||
# This is internal class to resolve Wildfly compatibility | ||
class jboss::internal::compatibility::wildfly { | ||
include jboss | ||
include jboss::internal::compatibility::common | ||
$_osfamily_down = $jboss::internal::compatibility::common::osfamily_down | ||
|
||
if versioncmp($jboss::version, '8.0.0') < 0 or versioncmp($jboss::version, '11.0.0') >= 0 { | ||
fail("Unsupported version ${jboss::product} ${jboss::version}. Supporting only: Wildfly 8.x, 9.x and 10.x series") | ||
} | ||
$controller_port = '9990' | ||
$product_short = 'wildfly' | ||
|
||
if versioncmp($jboss::version, '10.0.0') >= 0 { | ||
# after WFly 10.x | ||
$initd_file = "${jboss::home}/docs/contrib/scripts/init.d/wildfly-init-${_osfamily_down}.sh" | ||
$systemd_file = "${jboss::home}/docs/contrib/scripts/systemd/wildfly.service" | ||
$systemd_launcher = "${jboss::home}/docs/contrib/scripts/systemd/launch.sh" | ||
case $::osfamily { | ||
'RedHat': { | ||
case $::operatingsystem { | ||
'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL': { | ||
if (versioncmp($::operatingsystemrelease, '7.0') > 0) { | ||
$initsystem = 'SystemD' | ||
} else { | ||
$initsystem = 'SystemV' | ||
} | ||
} | ||
'Fedora': { | ||
if (versioncmp($::operatingsystemrelease, '21') > 0) { | ||
$initsystem = 'SystemD' | ||
} else { | ||
$initsystem = 'SystemV' | ||
} | ||
} | ||
default: { | ||
fail("Unsupported OS: ${::operatingsystem}") | ||
} | ||
} | ||
} | ||
'Debian': { | ||
case $::lsbdistcodename { | ||
'lenny','squeeze','lucid','natty','wheezy','precise','quantal','raring','saucy','trusty','utopic' : { | ||
$initsystem = 'SystemV' | ||
} | ||
'jessie','vivid','wily','xenial': { | ||
$initsystem = 'SystemD' | ||
} | ||
default: { fail("Unsupported release ${::lsbdistcodename}") } | ||
} | ||
} | ||
default: { | ||
fail("Unsupported OS family: ${::osfamily}. Supporting only RHEL and Debian systems. Consult README file.") | ||
} | ||
} | ||
} else { | ||
# for WFly 8.x, 9.x | ||
$initsystem = 'SystemV' | ||
$initd_file = "${jboss::home}/bin/init.d/wildfly-init-${_osfamily_down}.sh" | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'jboss::wildfly10 smoke test', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | ||
let(:pp) { Testing::Acceptance::SmokeTestReader.smoke_pp :'jboss::wildfly10' } | ||
|
||
it 'should add install WildFly 10 with no errors' do | ||
apply_manifest(pp, :expect_changes => true, :trace => true) | ||
end | ||
it 'should work idempotently' do | ||
apply_manifest(pp, :catch_changes => true, :trace => true) | ||
end | ||
describe service('wildfly') do | ||
it { is_expected.to be_running } | ||
end | ||
after(:all) do | ||
extend Testing::Acceptance::Cleaner | ||
remove_jboss_installation('wildfly') | ||
end | ||
end |