-
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.
Quality enhancements for Code Review
Rewrite of deploy provider with support of determining deployment digest. Now deploy provider checks if it should deploy an artifact based on their SHA1 digest. Also, adding some quality enhancements to pass Code Review without errors, that's Code Climate and CodeCov. Should fix issues: #70, #71
- Loading branch information
Showing
89 changed files
with
5,569 additions
and
3,078 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
include jboss | ||
|
||
jboss::clientry { '/subsystem=messaging/hornetq-server=default': | ||
ensure => 'present', | ||
properties => { | ||
'security-enabled' => true, | ||
} | ||
} |
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,36 @@ | ||
class { 'jboss': | ||
enableconsole => true, | ||
} | ||
|
||
jboss::user { 'admin': | ||
password => 'seCret1!', | ||
} | ||
|
||
jboss::datasource { 'test-datasource': | ||
ensure => 'present', | ||
xa => true, | ||
username => 'test-username-changed', | ||
password => 'test-password-1', | ||
jdbcscheme => 'h2:mem', | ||
dbname => 'testing2', | ||
host => '', | ||
port => '', | ||
driver => { | ||
'name' => 'h2', | ||
'driver-xa-datasource-class-name' => 'org.h2.jdbcx.JdbcDataSource' | ||
} | ||
} | ||
|
||
jboss::datasource { 'test-xa-datasource': | ||
ensure => 'present', | ||
xa => false, | ||
username => 'test-username-changed', | ||
password => 'test-password-changed', | ||
jdbcscheme => 'h2:mem', | ||
dbname => 'testing-xa-2;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE', | ||
host => '', | ||
port => '', | ||
driver => { | ||
'name' => 'h2' | ||
} | ||
} |
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,26 @@ | ||
include jboss | ||
|
||
ensure_packages(['wget']) | ||
|
||
$sourcedir = '/usr/src' | ||
$version = '2.23' | ||
$artifact = 'servlet3-webapp' | ||
$group = 'org/glassfish/jersey/examples' | ||
$file = "${artifact}-${version}.war" | ||
$deployment = "${artifact}.war" | ||
$fullpath = "${sourcedir}/${file}" | ||
|
||
exec { "wget https://repo1.maven.org/maven2/${group}/${artifact}/${version}/${file}": | ||
alias => 'wget', | ||
path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | ||
cwd => $sourcedir, | ||
creates => $fullpath, | ||
require => Package['wget'], | ||
} | ||
|
||
jboss::deploy { $deployment: | ||
ensure => 'present', | ||
path => $fullpath, | ||
subscribe => Exec['wget'], | ||
# servergroup => 'foobar-group', # on domain mode | ||
} |
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,11 @@ | ||
include jboss | ||
|
||
jboss::jmsqueue { 'app-mails': | ||
ensure => 'present', | ||
durable => true, | ||
entries => [ | ||
'queue/app-mails', | ||
'java:jboss/exported/jms/queue/app-mails', | ||
'queue/x-app-mails', | ||
], | ||
} |
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,33 @@ | ||
include jboss | ||
|
||
ensure_packages(['wget']) | ||
|
||
$sourcedir = '/usr/src' | ||
$version = '2.1.0' | ||
$artifact = 'genericconnector-rar' | ||
$group = 'ch/maxant' | ||
$file = "${artifact}-${version}.rar" | ||
$fullpath = "${sourcedir}/${file}" | ||
|
||
exec { "wget https://repo1.maven.org/maven2/${group}/${artifact}/${version}/${file}": | ||
alias => 'wget', | ||
path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | ||
cwd => $sourcedir, | ||
creates => $fullpath, | ||
require => Package['wget'], | ||
} | ||
|
||
jboss::resourceadapter { 'genericconnector.rar': | ||
archive => 'genericconnector.rar', | ||
transactionsupport => 'XATransaction', | ||
classname => 'ch.maxant.generic_jca_adapter.ManagedTransactionAssistanceFactory', | ||
jndiname => 'java:/jboss/jca-generic-x', | ||
} | ||
|
||
jboss::deploy { 'genericconnector.rar': | ||
path => $fullpath, | ||
require => [ | ||
JBoss::Resourceadapter['genericconnector.rar'], | ||
Exec['wget'], | ||
], | ||
} |
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,14 @@ | ||
include jboss | ||
|
||
jboss::securitydomain { 'db-auth-default': | ||
ensure => 'present', | ||
code => 'Database', | ||
codeflag => 'required', | ||
moduleoptions => { | ||
'dsJndiName' => 'java:jboss/datasources/x-default-db', | ||
'principalsQuery' => 'select \'password\' from user u where u.login = ?', | ||
'hashUserPassword' => true, | ||
'hashStorePassword' => false, | ||
'rolesQuery' => 'select r.name, \'roles\' from users', | ||
}, | ||
} |
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,6 @@ | ||
include jboss | ||
|
||
jboss::user { 'admin': | ||
ensure => 'present', | ||
password => 't0p-5seCret1!', | ||
} |
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 |
---|---|---|
@@ -1,105 +1,5 @@ | ||
require File.expand_path(File.join(File.dirname(__FILE__), '../../puppet_x/coi/jboss')) | ||
|
||
Puppet::Type.newtype(:jboss_confignode) do | ||
|
||
@doc = "Generic configuration entry for JBoss Application Sever" | ||
|
||
newproperty(:ensure) do | ||
desc "Whether a configuration node should be in one of `present`, `absent`, `running`, `stopped`, `disabled` or `enabled` state." | ||
|
||
newvalues :stopped, :running, :present, :absent, :enabled, :disabled | ||
|
||
aliasvalue(:true, :present) | ||
aliasvalue(:false, :absent) | ||
|
||
end | ||
newparam(:name) do | ||
desc "The name of resource" | ||
end | ||
|
||
newparam(:path) do | ||
desc "The JBoss configuration path to be ensured" | ||
end | ||
|
||
newproperty(:properties) do | ||
desc "Additional properties for node" | ||
|
||
munge do |value| | ||
if %w{absent undef}.include?(value) | ||
value.to_sym | ||
else | ||
matcher = PuppetX::Coi::Jboss::BuildinsUtils::HashlikeMatcher.new(value) | ||
unless matcher.hashlike? | ||
{} | ||
else | ||
value | ||
end | ||
end | ||
end | ||
|
||
def change_to_s(current, desire) | ||
absentlike = PuppetX::Coi::Jboss::Constants::ABSENTLIKE_WITH_S | ||
changes = [] | ||
keys = [] | ||
keys.concat(desire.keys) unless absentlike.include?(desire) | ||
keys.concat(current.keys) unless absentlike.include?(current) | ||
keys.uniq.sort.each do |key| | ||
desired_value = if absentlike.include?(desire) then desire else desire[key] end | ||
current_value = if absentlike.include?(current) then current else current[key] end | ||
if absentlike.include?(desired_value) and not absentlike.include?(current_value) then | ||
message = "property '#{key}' was #{current_value.inspect} and has been removed" | ||
elsif absentlike.include?(current_value) and not absentlike.include?(desired_value) | ||
message = "property '#{key}' has been set to #{desired_value.inspect}" | ||
else | ||
message = "property '#{key}' has changed from #{current_value.inspect} to #{desired_value.inspect}" | ||
end | ||
changes << message unless current_value == desired_value | ||
end | ||
changes.join ', ' | ||
end | ||
end | ||
|
||
newparam(:profile) do | ||
desc "The JBoss profile name" | ||
defaultto "full" | ||
end | ||
|
||
newparam(:runasdomain, :boolean => true) do | ||
desc "Indicate that server is in domain mode" | ||
newvalues :true, :false | ||
defaultto :true | ||
|
||
munge do |val| | ||
val == :true or val == true | ||
end | ||
end | ||
|
||
newparam(:controller) do | ||
desc "Domain controller host:port address" | ||
validate do |value| | ||
if value == nil or value.to_s == 'undef' | ||
raise ArgumentError, "Domain controller must be provided" | ||
end | ||
end | ||
end | ||
|
||
newparam :ctrluser do | ||
desc 'A user name to connect to controller' | ||
end | ||
|
||
newparam :ctrlpasswd do | ||
desc 'A password to be used to connect to controller' | ||
end | ||
|
||
newparam :retry do | ||
desc "Number of retries." | ||
defaultto 3 | ||
end | ||
|
||
newparam :retry_timeout do | ||
desc "Retry timeout in seconds" | ||
defaultto 1 | ||
end | ||
|
||
|
||
PuppetX::Coi::Jboss::Type::ConfigNode.define(self) | ||
end |
Oops, something went wrong.