Coder Social home page Coder Social 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 Introduction

Puppet Module for JBoss EAP and Wildfly application servers

...with configuration management of resources and deployment in domain and stand-alone modes

Build Status CircleCI Puppet Forge Code Climate Coverage Status Inline docs Join the chat at https://gitter.im/coi-gov-pl/puppet-jboss

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with JBoss
  4. What JBoss module affects
  5. Beginning with JBoss module
  6. Install classes reference
  7. Configuration classes reference
  8. Application defined types reference
  9. Technical defined types reference
  10. Logging configuration defined types
  11. JBoss module standard metaparameters
  12. Limitations - OS compatibility, etc.
  13. Development - Guide for contributing to the module

Overview

This module can install JBoss Enterprise Application Platform and WildFly application servers. It can also manage their resources and applications in either a domain or a stand-alone mode. It supports resources like datasource, security domain, JMS queues and any other custom CLI reachable attributes and path. It can also deploy your applications.

Module Description

The Center for Information Technology in Poland manage the JBoss application server farm. We were looking for a simple tool to support and automate the management of these servers in the spirit of DevOps methodology. The tool should also be powerful enough to satisfy all, even future requirements. Nothing was able to meet our requirements, so we have designed and wrote the corresponding Puppet module.

The module allows user to perform all necessary operations for JBoss servers. Here are couple of features:

  • Installation and upgrading of application servers in domain and standalone modes,
  • support for JBoss AS, EAP, and WildFly,
  • support for the Red Hat and Debian operating systems families,
  • installation of internal JBoss modules and their generation from a set of libraries,
  • configuration in a domain configuration mode (including the creation of virtual servers and groups of servers) and also standalone mode,
  • JBoss user management,
  • management of JBoss network interfaces,
  • JPA datasource management, security domains, JMS queues, resource adapters and system logging
  • deployment and removing of artifacts

In addition to the above list, you can also configure any JBoss CLI reachable configuration, with the entire set of parameters. This allows you to configure any parameter supported by JBoss.

Got questions?

We will be happy to receive your feedback. Ask as about everything releated to this module on Gitter.im chat!

Setup

What JBoss module affects

  • This module installs JBoss Application Servers from zip files distributed by Red Hat. Those files are being extracted to target directory, by default: /usr/lib/<product>-<version>/ for ex.: /usr/lib/wildfly-8.2.0.Final.
  • Module will also add service with name of $jboss::product for ex.: /etc/init.d/wildfly
  • 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
  • By default module will install and use wget package to download zip files

Beginning with JBoss module

To install JBoss Application Server you can use just, it will install Wildfly 8.2.0.Final by default:

include jboss

To install JBoss EAP or older JBoss AS use:

class { 'jboss':
  product => 'jboss-eap',
  version => '6.4.0.GA',
}

or use hiera:

jboss::params::product: 'wildfly'
jboss::params::version: '10.1.0.Final'

Install classes reference

Those classes are main module classes, that handles most of the typical workflow. Use them to install the main porduct - JBoss or Wildfly.

The jboss install class

The jboss main class is used to install the application server itself. It can install it on default parameters but you can use then to customize installation procedure.

Example:

include jboss

or with parameters:

class { 'jboss':
  enableconsole => true,
  environment   => {
    'JAVA_OPTS' => "\${JAVA_OPTS} -XX:+UseG1GC",
  },
}

More about jboss class on Wiki.

Configure classes reference

Those classes are here to configure your JBoss/Wildfly instance.

The jboss::domain::controller configure class

This class will setup parameters for JBoss server to run as controller of the domain. It has no parameters. This class must be used before main JBoss class for ex.:

# This include must be defined before JBoss main class
include jboss::domain::controller

class { 'jboss':
  enableconsole => true,
}

The jboss::domain::node configure class

This class will setup JBoss server to run as node of the domain.

It takes two parameters: ctrluser and ctrlpassword. User name and password must be setup to JBoss controller. Easiest way to add jboss management user with jboss::user type.

$user = 'jb-user'
$passwd = 'SeC3eT!1'

node 'controller' {
  include jboss::domain::controller
  include jboss
  jboss::user { $user:
    ensure   => 'present',
    password => $passwd,
  }
}

node 'node' {
  class { 'jboss::domain::node':
    ctrluser     => $user,
    ctrlpassword => $passwd,
  }
}

Application defined types reference

Application defined types are here to be directly expected by applications running on your application server. Most likely to written by application developers.

The jboss::datasource defined type

This defined type can be used to add and remove JBoss data sources. It support both XA and Non-XA data sources. It can setup data sources and manage required drivers.

# Non-XA data source
jboss::datasource { 'test-datasource':
  ensure     => 'present',
  username   => 'test-username',
  password   => 'test-password',
  jdbcscheme => 'h2:mem',
  dbname     => 'testing;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
  host       => '',
  port       => '',
  driver     => {
    'name'       => 'h2',
  }
}
# XA data source
jboss::datasource { 'test-xa-datasource':
  ensure     => 'present',
  xa         => true,
  username   => 'test-username',
  password   => 'test-password',
  jdbcscheme => 'h2:mem',
  dbname     => 'testing-xa;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
  host       => '',
  port       => '',
  driver     => {
    'name'                            => 'h2',
    'driver-xa-datasource-class-name' => 'org.h2.jdbcx.JdbcDataSource'
  }
}

More on parameters for jboss::datasource defined type on Wiki.

The jboss::jmsqueue defined type

Use this defined type to add and remove JBoss JMS Queues.

jboss::jmsqueue { 'app-mails':
  ensure  => 'present',
  durable => true,
  entries => [
    'queue/app-mails',
    'java:jboss/exported/jms/queue/app-mails',
  ],
}

More on parameters for jboss::jmsqueue defined type on Wiki.

The jboss::resourceadapter defined type

This defined type can be used to add and remove JBoss resource adapters. A resource adapter is a deployable Java EE component that provides communication between a Java EE application and an Enterprise Information System (EIS) using the Java Connector Architecture (JCA) specification

See more info here: https://docs.oracle.com/javaee/6/tutorial/doc/bncjh.html

jboss::deploy { 'jca-filestore.rar':
  jndi => 'jca-filestore.rar',
}

jboss::resourceadapter { 'jca-filestore.rar':
  archive            => 'jca-filestore.rar',
  transactionsupport => 'LocalTransaction',
  classname          => 'org.example.jca.FileSystemConnectionFactory',
  jndiname           => 'java:/jboss/jca/photos',
  require            => JBoss::Deploy['jca-filestore.rar'],
}

More on parameters for jboss::resourceadapter defined type on Wiki.

The jboss::securitydomain defined type

This defined type can be used to add and remove JBoss security domains. A security domain consists of configurations for authentication, authorization, security mapping, and auditing. It implements Java Authentication and Authorization Service (JAAS) declarative security.

See here: https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Security_Guide/sect-Security_Domains.html

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 = ?',
  },
}

More on parameters for jboss::securitydomain defined type on Wiki.

The jboss::module defined type

This defined type can add and remove JBoss static modules. Static modules are predefined in the JBOSS_HOME/modules/ directory of the application server. Each sub-directory represents one module and contains one or more JAR files and a configuration file - module.xml.

More info on modules here: https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/chap-Class_Loading_and_Modules.html

jboss::module { 'postgresql-jdbc':
  layer        => 'jdbc',
  artifacts    => [
    'https://jdbc.postgresql.org/download/postgresql-9.4-1204.jdbc41.jar',
  ],
  dependencies => [
    'javax.transaction.api',
    'javax.api',
  ],
}

After processing of this module JBoss server will be automatically restarted, but only when changes occur.

More on parameters for jboss::module defined type on Wiki.

The jboss::clientry defined type

This define is very versatile. It can be used to add or remove any JBoss CLI entry. You can pass any number of properties for given CLI path and each one will be manage, other parameters will not be changed.

jboss::clientry { '/subsystem=messaging/hornetq-server=default':
  ensure     => 'present',
  properties => {
    'security-enabled' => false,
  }
}

More on parameters for jboss::clientry defined type on Wiki.

Technical defined types reference

Technical defined types will be most likely used by system administrators to configure JBoss application servers to theirs needs.

The jboss::deploy defined type

This defined type can be used to deploy and undeploy standard Java artifacts to JBoss server

jboss::deploy { 'foobar-app':
  ensure      => 'present',
  servergroup => 'foobar-group',
  path        => '/usr/src/foobar-app-1.0.0.war',
}

More on parameters for jboss::deploy defined type on Wiki.

The jboss::user defined type

Use this defined type to add and remove JBoss management and application users, manage their passwords and roles.

jboss::user { 'admin':
  ensure   => 'present',
  realm    => 'ManagementRealm',
  password => 'seCret1!',
}

More on parameters for jboss::user defined type on Wiki.

The jboss::interface defined type

This defined type can be used to setup JBoss interfaces. It can add, remove or change existing interfaces.

More info about interfaces may be found here: https://docs.jboss.org/author/display/WFLY8/Interfaces+and+ports

jboss::interface { 'public':
  ensure       => 'present',
  inet_address => '192.168.5.33',
}

More on parameters for jboss::interface defined type on Wiki.

The jboss::domain::server defined type

This defined type simplifies creation and removal and updating JBoss domain virtual server (server instance) running on a host server (host controller) in domain mode.

include jboss

jboss::domain::servergroup { 'appsrv-group':
  ensure            => 'present',
  profile           => 'full-ha',
  heapsize          => '2048m',
  maxheapsize       => '2048m',
  jvmopts           => '-XX:+UseG1GC -XX:MaxGCPauseMillis=200',
  system_properties => {
    'java.security.egd' => 'file:/dev/urandom',
  }
}

jboss::domain::server { 'appsrv-01':
  ensure => 'present',
  group  => 'appsrv-group',
}

More on parameters for jboss::domain::server defined type on Wiki.

The jboss::domain::servergroup defined type

This defined type simplifies creation and removal and updating JBoss domain server group that can enforce same configuration (profile, deployments and JVM settings) across multiple servers on multiple host controllers. This is only possible in domain mode.

include jboss

jboss::domain::servergroup { 'app-group':
  ensure            => 'present',
  profile           => 'full-ha',
  heapsize          => '2048m',
  maxheapsize       => '2048m',
  jvmopts           => '-XX:+UseG1GC -XX:MaxGCPauseMillis=200',
  system_properties => {
    'java.security.egd' => 'file:/dev/urandom',
  }
}

More on parameters for jboss::domain::servergroup defined type on Wiki.

Logging configuration defined types

Logging configuration defined types are wrappers for jboss::clientry type, being written for ease of use for system administrators.

JBoss module standard metaparameters

Most of the defined types uses JBoss Puppet module standard metaparameters. Their description can be found on Wiki page.

Limitations

This module is explicitly tested on:

  • Oracle Linux 6.x, CentOS 6.x
  • Ubuntu Server LTS 14.04

With servers:

  • JBoss AS 7.1
  • JBoss EAP 6.1 - 6.4, 7.0
  • WildFly 8.x, 9.x

Should be fully compatible with those operating systems:

  • Red Hat Enterprise Linux: 5.x, 6.x
  • CentOS: 5.x, 6.x
  • Scientific: 5.x, 6.x
  • Oracle Linux: 5.x
  • Debian: 6.x, 7.x
  • Ubuntu Server LTS 12.04, 10.04

Supported Puppet versions:

  • Puppet OSS: 2.7.x, 3.x
  • Puppet Enterprise: 2.8.x, 3.x

Development

To contribute to this module please read carefully the CONTRIBUTING.md

Changelog

  • 1.2.1 - PeachSplash

    • Enchantment #99: Modernization of module structure
    • Bugfix #101: Stabilization and diversification of tests
  • 1.2.0 - PoppySilver

    • Feature #95 Adding support for JBoss EAP 7 and WildFly 10
  • 1.1.0 - RiverBlue

    • Bug #88 Wrong order beetwen jboss::internal::module::assembly and jboss::user
    • Bug #53 Problem with creating security domain on JBoss EAP 6.4 or Wildfly 9
    • Bug #65 Improper handling of download_url parameter
    • Bug #47 Idempotency breaks on Jboss::Internal::Service/Service[..] when running inside Docker container
    • Bug #56 Fix ownership of layers.conf file
    • Bug #14 Fix interface configuration for Wildfly 9 and EAP 7
    • Tests #66 Make tests run quicker and make them more atomic
    • Tests #44 Write rspec test to cover puppet resources (up to 50%)
    • Tests #72 Acceptance tests uses real examples written in separete .pp files
    • Quality #90, #83 Improve documentation level
    • Enhancement #20 Trigger deployment on refresh and add runtime_name param
  • 1.0.3 - RubyCake

    • Bug: #9 Correct a way that options are validated and displyed for datasource type
    • Bug: #8 Correct a way that port and host are validated for datasource type
    • Bug: #21 Fix hiera key in params.pp for java_autoinstall parameter
    • Bug: #17 Fix to be able to supply install zip as off-line file
    • Quality: #22 Fix Puppet Forge warning: "Dependencies contain unbounded ranges."
    • Quality: #41 Adding code of conduct file
    • Tests: #10 Write spec test to cover not covered Ruby files (up 80%)
    • CI: #34 Running acceptance tests on rvm 2.1 instead of default
    • CI: #4 Try to execute standard Ruby builds on Travis CI on container infrastructure
  • 1.0.2 - MintyFrost

    • Enhancement: move documentation to the Wiki and document all public manifests
    • Bug: make acceptance tests work on Travis
  • 1.0.0 - First public release

    • First publicly available version
    • Support for JBoss EAP, JBoss AS and Wildfly
    • Support for JPA datasource management, Security Domain JBoss, JMS queues, resource adapters and messages logging
    • Support for deploying artifacts

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

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

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 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))

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.

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.

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

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

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"

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

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.

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)

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

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

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]

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

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

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

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

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.

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

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

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

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

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 ~]#

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

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

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.

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

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.

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

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)

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.