Giter VIP home page Giter VIP logo

coi-gov-pl / puppet-jboss Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 8.0 1.03 MB

Installs JBoss EAP and WildFly application servers and manage their resources and applications in either a domain or a stand-alone mode

License: Apache License 2.0

Ruby 73.40% Augeas 1.17% Shell 4.41% Puppet 20.40% HTML 0.62%
jboss-server jboss-eap puppet-jboss puppet-module wildfly puppet-forge jms-queue datasource configuration-management

puppet-jboss's People

Contributors

afrimberger avatar bejusek avatar blaa avatar cardil avatar frodoslaw avatar garagoth avatar therek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-jboss's Issues

Idempotency breaks on Jboss::Internal::Service/Service[..] when running inside Docker container

When running inside Docker container idempotency breaks on Jboss::Internal::Service/Service[..]. Puppet tries to set enable property from 'false' to 'true'.

[root@wfly jboss]# puppet apply tests/domain/controller.pp
notice: /Stage[main]/Jboss::Internal::Service/Service[wildfly]/enable: enable changed 'false' to 'true'
notice: /Stage[main]/Jboss::Internal::Service/Exec[jboss::service::test-running]: Triggered 'refresh' from 1 events
notice: Finished catalog run in 2.37 seconds
[root@wfly jboss]# puppet apply tests/domain/controller.pp
notice: /Stage[main]/Jboss::Internal::Service/Service[wildfly]/enable: enable changed 'false' to 'true'
notice: /Stage[main]/Jboss::Internal::Service/Exec[jboss::service::test-running]: Triggered 'refresh' from 1 events
notice: Finished catalog run in 2.50 seconds

This should be addressed, but it's not priority in my opinion. I think like that because use case for this is rather vague: "Managing JBoss inside a Docker container using Puppet". It's not impossible, though.

Fix to be able to supply install zip as off-line file

I have the following yaml:
boss::params::product: 'wildfly'
jboss::params::version: '8.2.11.Final'
jboss::params::download_url: '/vagrant/salt/states/puppetmaster/files/wildfly-external-resources/wildfly-8.2.1.Final.zip'

using /vagrant or file:/vagrant will not help. It would be nice to supply the wildfly offline.

Notice: /Stage[main]/Jboss::Internal::Package/Exec[jboss::unzip-downloaded]/returns: [/usr/src/download-wildfly-8.2.11.Final/wildfly-8.2.11.Final.zip]
Notice: /Stage[main]/Jboss::Internal::Package/Exec[jboss::unzip-downloaded]/returns: End-of-central-directory signature not found. Either this file is not
Notice: /Stage[main]/Jboss::Internal::Package/Exec[jboss::unzip-downloaded]/returns: a zipfile, or it constitutes one disk of a multi-part archive. In the
Notice: /Stage[main]/Jboss::Internal::Package/Exec[jboss::unzip-downloaded]/returns: latter case the central directory and zipfile comment will be found on
Notice: /Stage[main]/Jboss::Internal::Package/Exec[jboss::unzip-downloaded]/returns: the last disk(s) of this archive.
Notice: /Stage[main]/Jboss::Internal::Package/Exec[jboss::unzip-downloaded]/returns: unzip: cannot find zipfile directory in one of /usr/src/download-wildfly-8.2.11.Final/wildfly-8.2.11.Final.zip or
Notice: /Stage[main]/Jboss::Internal::Package/Exec[jboss::unzip-downloaded]/returns: /usr/src/download-wildfly-8.2.11.Final/wildfly-8.2.11.Final.zip.zip, and cannot find /usr/src/download-wildfly-8.2.11.Final/wildfly-8.2.11.Final.zip.ZIP, period.
Error: unzip -o -q /usr/src/download-wildfly-8.2.11.Final/wildfly-8.2.11.Final.zip -d /usr/lib/wildfly-8.2.11.Final returned 9 instead of one of [0]
Error: /Stage[main]/Jboss::Internal::Package/Exec[jboss::unzip-downloaded]/returns: change from notrun to 0 failed: unzip -o -q /usr/src/download-wildfly-8.2.11.Final/wildfly-8.2.11.Final.zip -d /usr/lib/wildfly-8.2.11.Final returned 9 instead of one of [0]

Support for add-protocol() and remove-protocol() in lib/provider/jboss_confignode

Hi,

We are heavily working with the COI puppet-jboss module and currently develop an extension to manage domain profiles. Currently, we plan to generate profiles based on the "ha" profile suppled by JBoss EAP 6.4. The module extension is almost complete. The "JBoss not running" part is complete and tested, however, right now, we stuck with the "JBoss running" part attempting to implement the jgroups subsystem. In order to manage the jgroups udp and tcp protocols, the JBoss CLI functions add-protocol() and remove-protocol() functions are used, but they are not (yet) implemented in the provider library function jboss_confignode.

Do you see a reasonable way to implement add-protocol() and remove-protocol() in jboss_confignode?

Thanks, and cheers,
Heinz

Acceptance tests do not work on Travis now default Ruby 2.2

Travis switched default Ruby to version 2.2 Now all acceptance tests that where running on RVM: default setting fail with message:

NameError: uninitialized constant Syck

There is a need to set RVM to 2.1 in acceptance tests until support for Ruby 2.2 will be available.

Request for opinion: Instancable jboss-standalone

Hi all

Currently I am working on a Red Hat customer project, where I can provide code back via OpenSource licensing. The requirements lead to instantiate jboss-standalone.
At the current point we have to decide whether to extend coi/jboss with this functionality or the create an own module. Can you please kindly provide feedback to me, whether you would be generally accepting and later merging this feature enhancement (given that it would fulfill your contribution guidelines)?

PS.: Please provide feedback as soon as possible.

Kind regards
Sascha

CC: @klenkes74

Make tests run quicker and make them more atomic

For now we have 1600 tests examples and it takes to long to run them after every change while developing or refactoring. The tests are over-engineered, with check for every element that is included or imported.

We need to make them more atomic so we will test if class has correct includes without testing includes and their internal parameters.

Error when testing interface.pp

Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > IN > ensure
Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > IN > exists?
Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > IN > compiledpath
Debug: Command send to JBoss CLI: /interface=public-additional:read-resource(include-runtime=true, include-defaults=false)
Debug: Output from JBoss CLI [#<Process::Status: pid=3890,exited(1)>]: {
    "outcome" => "failed",
    "failure-description" => "JBAS014807: Management resource '[(\"interface\" => \"public-additional\")]' not found",
    "rolled-back" => true
}

Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > OUT > status(): false
Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > OUT > ensure(): :absent
Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > IN > ensure=(:present)
Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > IN > create
Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > IN > exists?
Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > IN > compiledpath
Debug: Puppet::Type::Jboss_confignode::ProviderJbosscli[/interface=public-additional] > IN > compileprops
Debug: Command send to JBoss CLI: /interface=public-additional:add(up=nil, nic=nil, site-local-address=nil, public-address=nil, any-address=nil, any-ipv4-address=nil, any-ipv6-address=nil, virtual=nil, subnet-match=nil, inet-address=nil, point-to-point=nil, nic-match=nil, loopback-address=nil, link-local-address=nil, multicast=nil, loopback=nil)
Warning: JBoss CLI command failed, try 1/3, last status: 1, message: {
    "outcome" => "failed",
    "failure-description" => "JBAS014690: any-address is invalid",
    "rolled-back" => true
}

Debug: Command send to JBoss CLI: /interface=public-additional:add(up=nil, nic=nil, site-local-address=nil, public-address=nil, any-address=nil, any-ipv4-address=nil, any-ipv6-address=nil, virtual=nil, subnet-match=nil, inet-address=nil, point-to-point=nil, nic-match=nil, loopback-address=nil, link-local-address=nil, multicast=nil, loopback=nil)
Warning: JBoss CLI command failed, try 2/3, last status: 1, message: {
    "outcome" => "failed",
    "failure-description" => "JBAS014690: any-address is invalid",
    "rolled-back" => true
}

Debug: Command send to JBoss CLI: /interface=public-additional:add(up=nil, nic=nil, site-local-address=nil, public-address=nil, any-address=nil, any-ipv4-address=nil, any-ipv6-address=nil, virtual=nil, subnet-match=nil, inet-address=nil, point-to-point=nil, nic-match=nil, loopback-address=nil, link-local-address=nil, multicast=nil, loopback=nil)
Warning: JBoss CLI command failed, try 3/3, last status: 1, message: {
    "outcome" => "failed",
    "failure-description" => "JBAS014690: any-address is invalid",
    "rolled-back" => true
}

Debug: Command send to JBoss CLI: /interface=public-additional:add(up=nil, nic=nil, site-local-address=nil, public-address=nil, any-address=nil, any-ipv4-address=nil, any-ipv6-address=nil, virtual=nil, subnet-match=nil, inet-address=nil, point-to-point=nil, nic-match=nil, loopback-address=nil, link-local-address=nil, multicast=nil, loopback=nil)
Debug: Output from JBoss CLI [#<Process::Status: pid=4041,exited(1)>]: {
    "outcome" => "failed",
    "failure-description" => "JBAS014690: any-address is invalid",
    "rolled-back" => true
}

Error:
Configuration node failed to create:
[CLI command]: /interface=public-additional:add(up=nil, nic=nil, site-local-address=nil, public-address=nil, any-address=nil, any-ipv4-address=nil, any-ipv6-address=nil, virtual=nil, subnet-match=nil, inet-address=nil, point-to-point=nil, nic-match=nil, loopback-address=nil, link-local-address=nil, multicast=nil, loopback=nil)
[Error message]: {
    "outcome" => "failed",
    "failure-description" => "JBAS014690: any-address is invalid",
    "rolled-back" => true
}

/etc/puppet/modules/jboss/lib/puppet/provider/jbosscli.rb:229:in `executeWithFail'
/etc/puppet/modules/jboss/lib/puppet/provider/jbosscli.rb:188:in `bringUp'
/etc/puppet/modules/jboss/lib/puppet/provider/jboss_confignode/jbosscli.rb:14:in `create'
/etc/puppet/modules/jboss/lib/puppet/provider/jboss_confignode/jbosscli.rb:126:in `ensure='
/usr/lib/ruby/site_ruby/1.8/puppet/property.rb:178:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/property.rb:178:in `call_provider'
/usr/lib/ruby/site_ruby/1.8/puppet/property.rb:503:in `set'
/usr/lib/ruby/site_ruby/1.8/puppet/property.rb:581:in `sync'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:204:in `sync'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:128:in `sync_if_needed'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:81:in `perform_changes'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:20:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:204:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:217:in `eval_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:147:in `call'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:147:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:327:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:326:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:147:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/graph/relationship_graph.rb:118:in `traverse'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:138:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:169:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/util/log.rb:149:in `with_destination'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction/report.rb:112:in `as_logging_destination'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:168:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:120:in `apply_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:161:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:160:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:119:in `apply_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:227:in `run_internal'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:134:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/context.rb:64:in `override'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:244:in `override'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:133:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:297:in `apply_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:231:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/context.rb:64:in `override'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:244:in `override'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:193:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:154:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:381:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:507:in `plugin_hook'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:381:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:488:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:381:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:146:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:92:in `execute'
/usr/bin/puppet:8
Error: /Stage[main]/Main/Jboss::Interface[public-additional]/Jboss::Clientry[/interface=public-additional]/Jboss_confignode[/interface=public-additional]/ensure: change from absent to present failed:
Configuration node failed to create:
[CLI command]: /interface=public-additional:add(up=nil, nic=nil, site-local-address=nil, public-address=nil, any-address=nil, any-ipv4-address=nil, any-ipv6-address=nil, virtual=nil, subnet-match=nil, inet-address=nil, point-to-point=nil, nic-match=nil, loopback-address=nil, link-local-address=nil, multicast=nil, loopback=nil)
[Error message]: {
    "outcome" => "failed",
    "failure-description" => "JBAS014690: any-address is invalid",
    "rolled-back" => true
}

When making additional tests before release I found error in tests for interfaces.pp. This need to be resolved asap.

Write spec test to cover not covered Ruby files (up 80%)

Currentlly only those Ruby files are covered by spec tests:

lib/facter/jboss_running.rb
lib/puppet/provider/jboss_jdbcdriver/jbosscli.rb
lib/puppet/provider/jboss_datasource/jbosscli.rb
lib/puppet/provider/jbosscli.rb
lib/facter/jboss_fullconfig.rb
lib/facter/jboss_configfile.rb
lib/puppet/parser/functions/jboss_to_bool.rb
lib/puppet/parser/functions/jboss_to_i.rb
lib/puppet/parser/functions/jboss_to_s.rb
lib/puppet/type/jboss_datasource.rb
lib/puppet/type/jboss_jdbcdriver.rb
lib/puppet_x/coi/jboss/configuration.rb
lib/puppet_x/coi/jboss/functions/jboss_to_bool.rb
lib/puppet_x/coi/jboss/functions/jboss_to_i.rb
lib/puppet_x/coi/jboss/functions/jboss_to_s.rb
lib/puppet_x/coi/jboss/provider/datasource/post_wildfly_provider.rb
lib/puppet_x/coi/jboss/provider/datasource/pre_wildfly_provider.rb

Does files needs to be covered:

lib/puppet/type/jboss_resourceadapter.rb
lib/puppet/type/jboss_confignode.rb
lib/puppet/type/jboss_jmsqueue.rb
lib/puppet/type/jboss_securitydomain.rb
lib/puppet/type/jboss_deploy.rb
lib/puppet/parser/functions/jboss_short_version.rb
lib/puppet/parser/functions/jboss_basename.rb
lib/puppet/parser/functions/jboss_type_version.rb
lib/puppet/parser/functions/jboss_hash_setvalue.rb
lib/puppet/parser/functions/jboss_dirname.rb
lib/puppet/provider/jboss_resourceadapter/jbosscli.rb
lib/puppet/provider/jboss_confignode/jbosscli.rb
lib/puppet/provider/jboss_jmsqueue/jbosscli.rb
lib/puppet/provider/jboss_securitydomain/jbosscli.rb
lib/puppet/provider/jboss_deploy/jbosscli.rb

Invalid relationship: Exec[jboss::unzip-downloaded]

After downloading the module:
root@puppetmaster modules]# puppet module install coi-jboss
Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppetlabs/code/environments/production/modules
coi-jboss (v1.0.0)
puppetlabs-concat (v1.2.4)
puppetlabs-java (v1.4.2)
puppetlabs-stdlib (v4.9.0)

and the following yaml:
jboss::params::product: 'wildfly'
jboss::params::version: '8.2.1.Final'

I get the following error with PE2015.2 on CentOS

[root@wildflyagent ~]# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Exec[jboss::unzip-downloaded] { require => Class[Jboss::Internal::Prerequisites] }, because Class[Jboss::Internal::Prerequisites] doesn't seem to be in the catalog
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[root@wildflyagent ~]#

Fix hiera key in params.pp for java_autoinstall parameter

According to README.md

By default module will install default Java JDK using puppetlabs/java module. This can be turned off by using $jboss::java_autoinstall variable or hiera key: jboss::params::java_autoinstall

But in params.pp, the key is not java_autoinstall but java_install

$java_autoinstall = jboss_to_bool(hiera('jboss::params::java_install', true))

Create define for patching JBoss/WildFly

Design

There should be a define that could patch and rollback JBoss and WildFly with Red Hat provided ZIP patches via HTTP/S or local files.

Examples:

Apply with HTTP downloading

jboss::patch { 'jboss-eap-6.4.8':
  ensure  => 'applied', # supporting also present, absent, rollbacked
  uri     => 'https://proxy.localdomain/redhat/jboss-eap/patches/6.4/jboss-eap-6.4.8-patch.zip',
  product => 'jboss-eap',
  version => '6.4.8',
}

Apply with local file

jboss::patch { 'jboss-eap-6.4.8':
  ensure => 'applied',
  uri    => 'file:///usr/src/jboss-eap-6.4.8-patch.zip',
}

Apply with puppet://

jboss::patch { 'jboss-eap-6.4.8':
  ensure => 'applied',
  uri    => 'puppet:///module/appserver/patches/jboss-eap-6.4.8-patch.zip',
}

Rollback specific version

jboss::patch { 'jboss-eap-6.4.8':
  ensure  => 'rollbacked',
  product => 'jboss-eap',
  version => '6.4.8',
}

Scope of change

  1. New manifest
  2. New backing type and provider
  3. Unit tests with rspec for backing type and provider Ruby code
  4. Integration tests with puppet-rspec for manifest
  5. Acceptance tests with beaker
  6. Documentation on README.md
  7. Documentation on Wiki GH pages

More info

Activate acceptance tests for centos-6, debian-7 and ubuntu-14.04 on Travis CI's Docker

There is a bug that prevents running of beaker acceptance tests on Travis CI's Docker installation. It is wide spread bug affecting other projects to.

/gemshome/gems/beaker-2.24.0/lib/beaker/hypervisor/docker.rb:86:in `block in provision': undefined method `[]' for nil:NilClass (NoMethodError)
    from /gemshome/gems/beaker-2.24.0/lib/beaker/hypervisor/docker.rb:49:in `each'

https://travis-ci.org/camptocamp/puppet-openldap/jobs/78376374

COI/JBoss example logs:

The bug is rather new...

Notify: @blaa @therek

Idempotency errors on jboss::deploy

There are idempotency errors on jboss::deploy: 'servlet3-webapp-2.22.2.war' already exists in the deployment repository (use --force to replace the existing content in the repository)

Beaker log fragment:

centos-6-x64 21:36:35$ puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.PbcIpb
  Info: Loading facts
  Info: Loading facts
  Info: Loading facts
  Info: Loading facts
  Notice: Compiled catalog for localhost.suszynski.org in environment production in 1.41 seconds
  Info: Applying configuration version '1457382996'
  Warning: JBoss CLI command failed, try 1/3, last status: 1, message: 'servlet3-webapp-2.22.2.war' already exists in the deployment repository (use --force to replace the existing content in the repository).
  Warning: JBoss CLI command failed, try 2/3, last status: 1, message: 'servlet3-webapp-2.22.2.war' already exists in the deployment repository (use --force to replace the existing content in the repository).
  Warning: JBoss CLI command failed, try 3/3, last status: 1, message: 'servlet3-webapp-2.22.2.war' already exists in the deployment repository (use --force to replace the existing content in the repository).
  Error: Could not set 'present' on ensure: 
  Deployment failed to create:
  [CLI command]: deploy /usr/src/servlet3-webapp-2.22.2.war --name=servlet3-webapp-2.22.2.war
  [Error message]: 'servlet3-webapp-2.22.2.war' already exists in the deployment repository (use --force to replace the existing content in the repository).
   at 47:/etc/puppet/modules/jboss/manifests/deploy.pp
  Error: Could not set 'present' on ensure: 
  Deployment failed to create:
  [CLI command]: deploy /usr/src/servlet3-webapp-2.22.2.war --name=servlet3-webapp-2.22.2.war
  [Error message]: 'servlet3-webapp-2.22.2.war' already exists in the deployment repository (use --force to replace the existing content in the repository).
   at 47:/etc/puppet/modules/jboss/manifests/deploy.pp
  Wrapped exception:

  Deployment failed to create:
  [CLI command]: deploy /usr/src/servlet3-webapp-2.22.2.war --name=servlet3-webapp-2.22.2.war
  [Error message]: 'servlet3-webapp-2.22.2.war' already exists in the deployment repository (use --force to replace the existing content in the repository).

  Error: /Stage[main]/Main/Jboss::Deploy[servlet3-webapp-2.22.2.war]/Jboss_deploy[servlet3-webapp-2.22.2.war]/ensure: change from absent to present failed: Could not set 'present' on ensure: 
  Deployment failed to create:
  [CLI command]: deploy /usr/src/servlet3-webapp-2.22.2.war --name=servlet3-webapp-2.22.2.war
  [Error message]: 'servlet3-webapp-2.22.2.war' already exists in the deployment repository (use --force to replace the existing content in the repository).
   at 47:/etc/puppet/modules/jboss/manifests/deploy.pp
  Notice: Finished catalog run in 18.27 seconds

centos-6-x64 executed in 21.40 seconds
Exited: 4

Steps to replicate:

  • Run puppet apply tests/deploy.pp twice (first is ok, second is failed)

Support for rake v11.0

In the newest version of Rake there is no support for Ruby version 1.8. We need to still support it so we need to download rake 10.5 in Gemfile for 1.8. In versions >1.8 we will use newest version of Rake.

Fix ownership of layers.conf file

Right now the following code in internal/module/registerlayer.pp class creates layers.conf file as root.

exec { "jboss::module::layer::${layer}":
  command => "/bin/awk -F'=' 'BEGIN {ins = 0} /^layers=/ { ins = ins + 1; print \$1=${layer},\$2 } END {if(ins == 0) print \"layers=${layer},base\"}' > ${jboss::home}/modules/layers.conf",
  unless  => "/bin/egrep -e '^layers=.*${layer}.*' ${jboss::home}/modules/layers.conf",
  require => Anchor['jboss::installed'],
  notify  => Service[$jboss::product],
}

On systems with umask other than default 0022, this file may become unreadable by jboss::jboss_user, thus preventing jboss service from starting.

This command should be executed as $jboss::jboss_user

Fix interface configuration for Wildfly 9

Interface configuration atrributes any-ipv4-address and any-ipv6-address have been removed in Wildfly 9. The interface configuration in puppet-jboss should be fixed to take that into account and retain backward compatibility.

The error message:

Warning: JBoss CLI command failed, try 1/3, last status: 1, message: {
    "outcome" => "failed",
    "result" => {},
    "failure-description" => {"host-failure-descriptions" => {"wbcdev" => "WFLYCTL0201: Unknown attribute 'any-ipv4-address'"}},
    "rolled-back" => true
}

Available interface configuration attributes:

{
    "outcome" => "success",
    "result" => {
        "any" => undefined,
        "any-address" => true,
        "inet-address" => undefined,
        "link-local-address" => undefined,
        "loopback" => undefined,
        "loopback-address" => undefined,
        "multicast" => undefined,
        "name" => "public",
        "nic" => undefined,
        "nic-match" => undefined,
        "not" => undefined,
        "point-to-point" => undefined,
        "public-address" => undefined,
        "site-local-address" => undefined,
        "subnet-match" => undefined,
        "up" => undefined,
        "virtual" => undefined
    }
}

Check hash of application to deploy before and after deployment

Provider for jboss_deploy type should take into consideration the content hash and compare it to the calculated hash of target file to be deployed. If both hashes do not match, provider should redeploy the artifact with target one and change should be reported as different content, hash changed from '{md5}59381b178aeeb198ef8d69e85e41702aaec5d80' to '{md5}e6d07fd0403ea06c6531155d80e1614b'

Here are the example CLI command with output:

[domain@localhost:9999 /] /deployment=sample-app:read-resource()
{
    "outcome" => "success",
    "result" => {
        "content" => [{"hash" => bytes {
            0x59, 0x38, 0x1b, 0x17, 0x8a, 0xee, 0xb1, 0x98,
            0xef, 0x8d, 0x69, 0xe8, 0x5e, 0x41, 0x70, 0x2a,
            0x0a, 0xec, 0x5d, 0x80
        }}],
        "name" => "sample-app",
        "runtime-name" => "sample-app"
    }
}

Notice that you can read those byte in Ruby like that:

bytes = [0x59, 0x38, 0x1b, 0x17, 0x8a, 0xee, 0xb1, 0x98, 0xef, 0x8d, 0x69, 0xe8, 0x5e, 0x41, 0x70, 0x2a, 0x0a, 0xec, 0x5d, 0x80]              
bytes.map {|b| b.to_s(16) }.join('')
=> "59381b178aeeb198ef8d69e85e41702aaec5d80"

Change the codeflag, code and moduleoptions to property in type SecurityDomain

Right now the codeflag, code and moduleoptions are parameters. There is no way to change them after resource creation.

When first executed example will create resource Jboss::Securitydomain[db-auth-default]:

include jboss

jboss::securitydomain { 'db-auth-default':
  ensure        => 'present',
  code          => 'Database',
  codeflag      => 'required',
  moduleoptions => {
    'dsJndiName'        => 'java:jboss/datasources/default-db',
    'principalsQuery'   => 'select \'password\' from users u where u.login = ?',
    'hashUserPassword'  => false,
    'hashStorePassword' => false,
    'rolesQuery'        => 'select r.name, \'Roles\' from users u
join user_roles ur on ur.user_id = u.id
join roles r on r.id = ur.role_id
where u.login = ?',
  },
}

When executing next time with different parameters nothing will change but it should change:

include jboss

jboss::securitydomain { 'db-auth-default':
  ensure        => 'present',
  code          => 'Database',
  codeflag      => 'required',
  moduleoptions => {
    'dsJndiName'        => 'java:jboss/datasources/default-db2',
    'principalsQuery'   => 'select paswd from users where login = ?',
    'hashUserPassword'  => true,
    'hashStorePassword' => false,   
  },
}

We should change them to property so we can have better manage them.

Idempotency errors on jboss::resourceadapter

There are idempotency errors on jboss::resourceadapter: undefined methodsize' for true:TrueClass`

Beaker log fragment:

centos-6-x64 21:09:16$ puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.EwfDcn
  Info: Loading facts
  Info: Loading facts
  Info: Loading facts
  Info: Loading facts
  Notice: Compiled catalog for localhost.suszynski.org in environment production in 1.76 seconds
  Info: Applying configuration version '1457381357'
  Error: /Stage[main]/Main/Jboss::Resourceadapter[genericconnector.rar]/Jboss_resourceadapter[genericconnector.rar]: Could not evaluate: undefined method `size' for true:TrueClass
  Notice: /Stage[main]/Jboss::Internal::Service/Service[wildfly]: Dependency Jboss_resourceadapter[genericconnector.rar] has failures: true
  Warning: /Stage[main]/Jboss::Internal::Service/Service[wildfly]: Skipping because of failed dependencies
  Notice: /Stage[main]/Jboss::Internal::Service/Exec[jboss::service::test-running]: Dependency Jboss_resourceadapter[genericconnector.rar] has failures: true
  Warning: /Stage[main]/Jboss::Internal::Service/Exec[jboss::service::test-running]: Skipping because of failed dependencies
  Notice: /Stage[main]/Jboss::Internal::Service/Exec[jboss::service::restart]: Dependency Jboss_resourceadapter[genericconnector.rar] has failures: true
  Warning: /Stage[main]/Jboss::Internal::Service/Exec[jboss::service::restart]: Skipping because of failed dependencies
  Notice: /Stage[main]/Jboss::Internal::Service/Anchor[jboss::service::end]: Dependency Jboss_resourceadapter[genericconnector.rar] has failures: true
  Warning: /Stage[main]/Jboss::Internal::Service/Anchor[jboss::service::end]: Skipping because of failed dependencies
  Notice: /Stage[main]/Main/Jboss::Deploy[genericconnector.rar]/Jboss_deploy[genericconnector.rar]: Dependency Jboss_resourceadapter[genericconnector.rar] has failures: true
  Warning: /Stage[main]/Main/Jboss::Deploy[genericconnector.rar]/Jboss_deploy[genericconnector.rar]: Skipping because of failed dependencies
  Notice: /Stage[main]/Jboss::Internal::Service/Anchor[jboss::service::started]: Dependency Jboss_resourceadapter[genericconnector.rar] has failures: true
  Warning: /Stage[main]/Jboss::Internal::Service/Anchor[jboss::service::started]: Skipping because of failed dependencies
  Notice: /Stage[main]/Jboss/Anchor[jboss::end]: Dependency Jboss_resourceadapter[genericconnector.rar] has failures: true
  Warning: /Stage[main]/Jboss/Anchor[jboss::end]: Skipping because of failed dependencies
  Notice: Finished catalog run in 5.53 seconds

centos-6-x64 executed in 9.14 seconds
Exited: 4
    should work idempotently (FAILED - 1)

Steps to replicate:

  • Run puppet apply tests/resourceadapter.pp twice (first is ok, second is failed)

Problem with creating security domain on JBoss EAP 6.4 or Wildfly 9

When trying to run jboss 6.4 after command to setup security domain

/profile=full-ha/subsystem=security/security-domain=db-auth-default/authentication=classic:add(login-modules=[{code=>"Database",flag=>"required",module-options=>[dsJndiName => "java:jboss/datasources/ds",hashStorePassword => "false",hashUserPassword => "false",principalsQuery => "select 'haslo' from uzytkownik u where u.login = upper(?)",rolesQuery => "select r.name, \'Roles\' from users u join user_roles ur on ur.user_id = u.id join roles r on r.id = ur.role_id
where u.login = ?"]}])

I got this error :

[Error message]: {
    "outcome" => "failed",
    "rolled-back" => true,
    "result" => undefined,
    "server-groups" => undefined
}

This error is caused by different handling of arguments in Jboss-eap 6.4

Add define jboss::cliexec that can execute any JBoss custom methods for any CLI path

This feature request describes new define: jboss::cliexec.

Description for Wiki (draft):

WIKI CUT HERE

The jboss::cliexec defined type

This define is very versatile. It can be used to execute any JBoss CLI method for any CLI path. This define also supports parameters onlyif and unless. One of them must be present to prevent idempotent issues, they should work similar to ones defined in Puppet build-in resource exec.

jboss::cliexec { '/subsystem=jgroups/stack=udp:add-protocol(type=PING)':
  unless => '/subsystem=jgroups/stack=udp/protocol=PING:read-resource',
}

Parameters of jboss::cliexec:

This type uses JBoss module standard metaparameters

unless parameter

The unless parameter can be used to check if resource should be executed. If passed command fails that means that it should be run. You must pass unless if not passing onlyif and only one of them can be set for given resource. Example:

jboss::cliexec { '/subsystem=jgroups/stack=udp:add-protocol(type=PING)':
  unless => '/subsystem=jgroups/stack=udp/protocol=PING:read-resource',
}

onlyif parameter

The onlyif parameter can be used to check if resource should be executed. If passed command succeds that means that it should be run. You must pass onlyif if not passing unless and only one of them can be set for given resource Example:

jboss::cliexec { '/subsystem=jgroups/stack=udp:remove-protocol(type=PING)':
  onlyif => '/subsystem=jgroups/stack=udp/protocol=PING:read-resource',
}

command parameter

This is the namevar. Command to be executed as full CLI entry and method. The command must be passed without /profile=<profile-name> in domain mode as well (for that profile parameter must be used).

basepath parameter

The base path can be used to shorten recurring paths in commands. Example:

jboss::cliexec { ':remove-protocol(type=PING)':
  onlyif   => '/protocol=PING:read-resource',
  basepath => '/subsystem=jgroups/stack=udp',
}

WIKI CUT HERE

Scope of change for this feature:

  • Create appropriate define jboss::cliexec
  • Puppet rspec tests for define jboss::cliexec
  • Acceptance tests for define jboss::cliexec
  • Smoke tests for define jboss::cliexec
  • Create appropriate type jboss_cliexec and default provider jboss_cliexec/jbosscli for it
  • Ruby rspec tests for type jboss_cliexec and provider jboss_cliexec/jbosscli
  • Deprecate dorestart parameter in jboss::clientry, backing type and providers and change rspec tests
  • Deprecate running and stopped options for ensure property in jboss::clientry, backing type and providers and change rspec tests
  • Change the way that jboss::domain::server is implemented. Use jboss::cliexec instead of dorestart. Also running and stopped options for ensure should be implemented with jboss::cliexec.
  • Documentation changes on README.md and Wiki pages

Correct a way that port and host are validated for type datasource

The host validation accepts any single character inside a string: https://github.com/coi-gov-pl/puppet-jboss/blob/develop/lib/puppet/type/jboss_datasource.rb#L101

The port validation accepts any single digit inside a string: https://github.com/coi-gov-pl/puppet-jboss/blob/develop/lib/puppet/type/jboss_datasource.rb#L111

Both accept spaces and invalid character. There should be something like ^[\w\.]*\w+$ for host and ^\d+$ for port

empty profile subsystem path breaks idempotency

Hi

I'm having idempotency issues when attempting to add empty subsystem sections to a profile in JBoss domain mode. I reduced the manifest to the following minimal file, ran it and include the output of the first (and all subsequent) puppet agent -t runs.

Manifest weld.pp (there are hiera data objects not shown here; they are most likely not relevant):

$profile           = 'ha-p2p-tst4-ext'
$subsystem    = 'weld'
$ensure          = 'present'
$controller      = "localhost:9999"

include jboss::internal::prerequisites
include jboss::domain::controller
include jboss

jboss::clientry { "/profile=$profile/subsystem=$subsystem":
  ensure      => $ensure,
  controller  => $controller,
  profile     => $profile,
  runasdomain => true,
}

Output of puppet agent -t:

[root@jbossdc manifests]# puppet apply weld.pp
Warning: Scope(Class[Jboss::Internal::Compatibility]): Could not look up qualified variable 'jboss::internal::service::servicename'; class jboss::internal::service has not been evaluated
Warning: Scope(Class[Jboss::Internal::Compatibility]): Could not look up qualified variable 'jboss::internal::service::servicename'; class jboss::internal::service has not been evaluated
Warning: Scope(Class[Jboss::Internal::Compatibility]): Could not look up qualified variable 'jboss::internal::service::servicename'; class jboss::internal::service has not been evaluated
Warning: Scope(Class[Jboss::Internal::Compatibility]): Could not look up qualified variable 'jboss::internal::service::servicename'; class jboss::internal::service has not been evaluated
Warning: Scope(Class[Jboss::Internal::Compatibility]): Could not look up qualified variable 'jboss::internal::service::servicename'; class jboss::internal::service has not been evaluated
Warning: Scope(Class[Jboss::Internal::Compatibility]): Could not look up qualified variable 'jboss::internal::service::servicename'; class jboss::internal::service has not been evaluated
Notice: Compiled catalog for jbossdc.safeswisscloud.net in environment production in 0.93 seconds
Notice: /Stage[main]/Main/Jboss::Clientry[/profile=ha-p2p-tst4-ext/subsystem=weld]/Jboss_confignode[/profile=ha-p2p-tst4-ext/subsystem=weld]/ensure: ensure changed '' to 'present'
Notice: /Stage[main]/Jboss::Internal::Service/Service[jboss-eap]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Jboss::Internal::Service/Exec[jboss::service::test-running]: Triggered 'refresh' from 1 events
Notice: Applied catalog in 11.52 seconds

As you see, even though I specified ensure => 'present', jboss_confignode somehow ignores it, gets an undef/nil (or empty '') value and changes it to 'present', resulting in a trigger for the domain controller host controller service.

Furthermore, what is the cause of the warnings? Did I forget to include anything?

Thanks, and cheers,
Heinz

Activate acceptance tests on Travis CI for Puppet Enterprise, at least 2.8.8 and 3.8.2

Travis CI is unable to run acceptance tests on docker because of low disk space.

Maybe on new Travis CI infrastructure this can be executed?

Failed builds:

Required fragment in .travis.yml file:

 - rvm: default
   sudo: required
   services: docker
   env: RS_SET="centos-6-x86_64-pe288-docker"
   script: bundle exec rake acceptance
 - rvm: default
   sudo: required
   services: docker
   env: RS_SET="centos-6-x86_64-pe382-docker"
   script: bundle exec rake acceptance

@coi-gov-pl/jboss-puppet-team

Speed up CLI providers by using Rjb - Ruby Java Bridge and JBoss command line API

The idea is to use native Java gateway to JBoss CLI instead of spawning command line processes separately. In theory this should greatly increase the speed of evaluating the catalog.

Example of using command line API here: https://developer.jboss.org/wiki/JBossAS7Command-linePublicAPI
RJB Homepage: http://www.artonx.org/collabo/backyard/?RubyJavaBridge

Sample Ruby code (will be delivered):

require 'rjb'
Rjb::load(classpath = '/usr/lib/wildfly-8.2.0.Final/bin/client/jboss-cli-client.jar')

CommandContext = Rjb::import('CommandContext')
# [..]

Scope of change:

  • puppet class jboss::plugins::rjb that will be included by default, and will install rjb gem into system (should be compatibile w Puppet OSS and Enterprise)
  • abstract provider code changes, implementing 2 strategies: process, rjb and using rjb if it is available and not specified explicitly by user.
  • unit and acceptance tests

After dropping support for Puppet 2.x, provider code can use features for providers

Improper handling of download_url parameter

download_url parameter in main class jboss has been moved to params file in commit 26c7345 (PR #26). This causes numerous issues when overriding $product or $version parameters using main class. Like this:

class { 'jboss':
  product => 'wildfly',
  version => '9.0.2.Final',
}

In this example $download_url is being resolved in params.pp file and default values of $product and $version are being used.

There are 2 propositions to fix this:

Move download_url to runtime class and calculate there

  • Moving $download_url to jboss::internal::runtime class
  • Set parameters from jboss class to jboss::internal::runtime class
  • Use parameters from jboss::internal::runtime class instead of params.pp
  • Update all references to $jboss::internal::runtime::download_url instead of $jboss::params::download_url

Calculate in params using product and version in runtime class

  • Set parameters from jboss class to jboss::internal::runtime class
  • Use parameters from jboss::internal::runtime class instead of params.pp

More detailed way to handle deployment states for jboss_deploy type & provider

Correct the way that system checks if deployment is present in the system and the way the states of deployments are handled

  • jboss_deploy ensure property should accept values: present, absent, enabled, assigned, uploaded
  • jboss_deploy provider should manage the state of server to one of the following states:
    • present =>
      • if current state is absent, provider should deploy and enable artifacts
      • if current state is one of enabled, added or uploaded it should not modify state
    • absent =>
      • always undeploy the artifacts from any state
    • enabled =>
      • always deploy the deployment and activate it in specified server groups
      • if list of server groups are different deployment should be adjusted to expected server groups
    • assigned =>
      • always ensure that deployment is not active but uploaded and assigned to specified server groups
      • if list of server groups are different deployment should be adjusted to expected server groups
    • uploaded =>
      • if state is absent should only upload deployment but should not be assigned and activated in any server groups
      • otherwise deployment should be unassigned from any server group

Add support for Puppet 4.x

This module should support running on modern version of Puppet 4.x

This also means dropping support for Ruby 1.8.x and probably Puppet 2.x

Correct a way that options are validated and displyed for datasource type

Option property for datasource type should not accept strings and symbols, even if they respond to :[] method. Options should accept only Map like objects and not string and symbols with exception for :absent, :undef and nil.

There should also be a correct message: 'options has been removed' if passing :absent, :undef or nil as a parameter.

Add support to puppetlabs/concat > 2.x

Hello,

I didn't test yet but would this module be compatible with concat 2.1.0 ?

I have another module which installed concat 2.1.0, resulting in puppet-jboss failing the dependency check (and puppet tried to download puppet-jboss 1.0.2 instead).

puppet-jboss 1.0.3:
{ "name": "puppetlabs/concat", "version_requirement": ">= 1.0.0 <2.0.0" }

puppet-jboss 1.0.2:
{"name":"puppetlabs/concat","version_requirement":">= 1.0.0"}

Try to execute standard Ruby builds on Travis CI on container infrastructure

Travis has enabled container infrastructure that's runs faster and can enable bundler cache. Downside for this is you are not able to run sudo command and therefore can't install anything as usual.

JBoss module uses a augeas lenses that should be newer 1.0.0 in order to rspec tests work. This is normally handled for older systems with jbxml-shim that uses newer version of XML lens. This is not possible in noop mode and unit tests. So libaugeas-dev >= 1.0.0 needs to be installed as a system dependency.

Currently this is handled by Travis install script https://github.com/coi-gov-pl/puppet-jboss/blob/develop/.travis.yml#L7

  - sudo add-apt-repository -y ppa:raphink/augeas
  - sudo apt-get update
  - sudo apt-get install -y libaugeas-dev libxml2-dev

In container based infrastructure this can be done with this fragment:

sudo: false
addons:
  apt:
    sources:
    - ppa:raphink/augeas
    packages:
    - libaugeas-dev
    - libxml2-dev
bundler_args: --without development --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
cache: bundler

Problem is that ppa:raphink/augeas is not considered trusted, and Travis installs default packages insead of newer versions: https://travis-ci.org/coi-gov-pl/puppet-jboss/jobs/81567020

Notify: @coi-gov-pl/jboss-puppet-team

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.