From 04946da46ea21dea92000bcee2f43941f421de37 Mon Sep 17 00:00:00 2001 From: Jairo Junior Date: Wed, 15 Mar 2017 10:37:58 -0300 Subject: [PATCH] Update docs. --- CHANGELOG.md | 6 + README.md | 428 +------------------------- lib/puppet/type/wildfly_cli.rb | 2 +- lib/puppet/type/wildfly_deployment.rb | 2 +- lib/puppet/type/wildfly_resource.rb | 2 +- lib/puppet/type/wildfly_restart.rb | 2 +- metadata.json | 6 +- 7 files changed, 22 insertions(+), 426 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1fc2fee..42ec661e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # History +## 2.0.0 + +- Introduce Puppet 4 features (epp, data types and etc) +- Introduce puppet-strings +- Small fixes fori JBoss-CLI Parser. + ## 1.2.7 - Keep compatibility with Ruby 1.8.7 (necessary while claiming compatibility with 2.7/3.8) diff --git a/README.md b/README.md index 313b4fbc..cf2278f5 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ * [Setup requirements](#setup-requirements) 4. [Upgrade](#upgrade) * [to 1.2.0](#to-120) + * [to 2.0.0](#to-200) 5. [Usage - Configuration options and additional functionality](#usage) * [Wildfly 10.1.0](#wildfly-1010) * [Wildfly 9.0.2](#wildfly-902) @@ -33,12 +34,8 @@ * [Messaging](#messaging) * [Logging](#logging) * [Modcluster](#modcluster) -6. [Reference - An under-the-hood peek at what the module is doing and how](#reference) - * [Public classes](#public-classes) - * [Private classes](#private-classes) - * [Public defined types](#public-defined-types) -7. [Limitations - OS compatibility, etc.](#limitations) -8. [Development - Guide for contributing to the module](#development) +6. [Limitations - OS compatibility, etc.](#limitations) +7. [Development - Guide for contributing to the module](#development) ## Overview @@ -125,6 +122,12 @@ All resources from `wildfly::util` were moved to `wildfly`, hence you need to se `find . -name '*.pp' -type f -exec sed -i 's/wildfly::util/wildfly/g' {} +` +## to 2.0.0 + +This version requires Puppet 4.4+ and heavily uses Puppet 4 new features: data types, epp templates and Ruby 2.1+, but there is no breaking change per se. + +If you're still using Puppet 3.x with Ruby 1.8.7+ check version 1.2.x. + ## Usage ```puppet @@ -799,419 +802,6 @@ wildfly::modcluster::config { "Modcluster mybalancer": > **NOTE:** For apache/httpd mod_cluster configuration check [::apache::mod::cluster](https://github.com/puppetlabs/puppetlabs-apache#class-apachemodcluster) -## Reference - -- [**Public classes**](#public-classes) - - [Class: wildfly](#class-wildfly) -- [**Private classes**](#private-classes) - - [Class: wildfly::prepare](#class-wildflyprepare) - - [Class: wildfly::install](#class-wildflyinstall) - - [Class: wildfly::setup](#class-wildflysetup) - - [Class: wildfly::service](#class-wildflyservice) -- [**Public defined types**](#public-defined-types) - - [Defined type: wildfly::resource](#defined-type-wildflyresource) - - [Defined type: wildfly::cli](#defined-type-wildflycli) - - [Defined type: wildfly::deployment](#defined-type-wildflydeployment) - - [Defined type: wildfly::reload](#defined-type-wildflyreload) - - [Defined type: wildfly::restart](#defined-type-wildflyrestart) - - [Defined type: wildfly::patch::offline](#defined-type-wildflypatchoffline) - - [Defined type: wildfly::patch::online](#defined-type-wildflypatchonline) - - [Defined type: wildfly::config::module](#defined-type-wildflyconfigmodule) - - [Defined type: wildfly::config::app_user](#defined-type-wildflyconfigapp_user) - - [Defined type: wildfly::config::mgmt_user](#defined-type-wildflyconfigmgmt_user) - - [Defined type: wildfly::config::user_groups](#defined-type-wildflyconfiguser_groups) - - [Defined type: wildfly::config::user_roles](#defined-type-wildflyconfiguser_roles) - -### Public classes - -#### Class: `wildfly` - -Guides the basic setup and installation of Wildfly on your system. - -When this class is declared with the default options, Puppet: - -- Download and installs Wildfly from a remote source in your system. -- Installs required packages (wget e libaio) -- Configures/starts the Wildfly service using bundled scripts. - -You can simply declare the default `wildfly` class: - -``` puppet -class { 'wildfly': } -``` - -#### Parameters within `wildfly` - -##### `version` - -Sets the Wildfly version managed in order to handle small differences among versions. Default: `9.0.2` - -##### `distribution` - -Sets the Wildfly distribution: `wildfly` or `jboss-eap`. Default: `wildfly` - -##### `install_source` - -Source of Wildfly tarball installer. Default: `http://download.jboss.org/wildfly/9.0.2.Final/wildfly-9.0.2.Final.tar.gz`. - -##### `java_home` - -Sets the `JAVA_HOME` for Wildfly. Default '/usr/java/default'. - -##### `manage_user` - -Whether this module should manage wildfly user and group. Default `true`. - -##### `group` - -Group to own `JBOSS_HOME`. If `manage_user` is `true`, this group will be managed. Default `wildfly`. - -##### `user` - -User to own `JBOSS_HOME`. If `manage_user` is `true`, this group will be managed. Default `wildfly`. - -##### `dirname` - -`WILDFLY_HOME`. i.e. The directory where your Wildfly will live. Default `/opt/wildfly`. - -##### `package_ensure` - -Wether this module should manage required packages (wget and liaio). Default `present`. - -##### `service_name` - -Sets Wildfly's service `name`. Default `wildfly`. - -##### `service_ensure` - -Sets Wildfly's service `ensure`. Default `true`. - -##### `service_enable` - -Sets Wildfly's service `enable`. Default `true`. - -##### `mode` - -Sets Wildfly execution mode will run, `standalone` or `domain`. Default `standalone`. - -##### `config` - -Sets Wildfly configuration file for initialization when you're using `standalone` mode. Default `standalone.xml`. - -##### `domain_config` - -Sets Wildfly configuration file for initialization when you're using `domain` mode. Default `domain.xml`. - -##### `host_config` - -Sets Wildfly Host configuration file for initialization when you're using `domain` mode. Default `host.xml`. - -##### `console_log` - -Configures service log file. Default `/var/log/wildfly/console.log`. - -##### `properties` - -Sets properties for your service. Default: - -``` -{ - 'jboss.bind.address' => '0.0.0.0', - 'jboss.bind.address.management' => '127.0.0.1', - 'jboss.management.http.port' => '9990', - 'jboss.management.https.port' => '9993', - 'jboss.http.port' => '8080', - 'jboss.https.port' => '8443', - 'jboss.ajp.port' => '8009', -} -``` - -##### `java_xmx` - -Sets Java's `-Xmx` parameter. Default `512m`. - -##### `java_xms` - -Sets Java's `-Xms` parameter. Default `128m`. - -##### `java_maxpermsize` - -Sets Java's `-XX:MaxPermSize` parameter. Default `256m`. - -##### `java_opts` - -Sets `JAVA_OPTS`, allowing to override several Java params, like `Xmx`, `Xms` and `MaxPermSize`, e.g. `-Xms64m -Xmx512m -XX:MaxPermSize=256m`. Default `undef`. - -##### `jboss_opts` - -Sets `JBOSS_OPTS`, allowing to override several JBoss properties. It only works with Wildfly 8.2+. Default `undef`. - -##### `mgmt_user` - -Hash containing Wildfly's management users to be managed. Default `{ username => 'puppet', password => fqdn_rand_string(30) }` - -### Private classes - -#### Class: `wildfly::prepare` - -Manages Wildfly requirements. - -#### Class: `wildfly::install` - -Downloads and installs Wildfly from a remote source. - -#### Class: `wildfly::setup` - -Manages Wildfly configuration required to run in service mode. - -#### Class: `wildfly::service` - -Manages Wildfly service. - -### Public defined types - -#### Defined type: `wildfly::resource` - -Manages a Wildfly configuration resource: e.g `/subsystem=datasources/data-source=MyDS or /subsystem=datasources/jdbc-driver=postgresql`. Virtually anything in your configuration XML file that can be manipulated using JBoss-CLI could be managed by this defined type. This define is a wrapper for `wildfly_resource` that defaults to your local Wildfly installation. - -#### Parameters within `wildfly::resource` - -##### `name` - -The name of this resource using JBoss path syntax e.g. `/subsystem=datasources/data-source=MyDS`. - -##### `ensure` - -Whether the resource should exist (`present`) or not (`absent`). Default `present`. - -##### `recursive` - -Whether it should manage the resource recursively or not. Default `false`. - -##### `content` - -Sets the content/state of the target resource. Default `{}`. - -##### `operation_headers` - -Sets [operation-headers](https://docs.jboss.org/author/display/WFLY9/Admin+Guide#AdminGuide-OperationHeaders) (e.g. `{ 'allow-resource-service-restart' => true, 'rollback-on-runtime-failure' => false, 'blocking-timeout' => 600}`) to be used when creating/destroying this resource. Default `{}`. - -##### `profile` - -Sets the target profile to prefix resource name. Requires domain mode. Default `undef`. - -#### Defined type: `wildfly::cli` - -Executes an arbitrary JBoss-CLI command `# [node-type=node-name (/node-type=node-name)*] : operation-name ['('[name=value [, name=value]*]')'] [{header (;header)*}]`. This define is a wrapper for `wildfly_cli` that defaults to your local Wildfly installation. - -#### Parameters within `wildfly::cli` - -##### `command (namevar)` - -The actual command to execute. Example: - -``` -/subsystem=datasources/data-source=ExampleDS:disable() -``` - -##### `unless` - -If this parameter is set, then this `cli` will only run if this command condition is met. Example: - -``` -(result == false) of /subsystem=datasources/data-source=ExampleDS:read-attribute(name=enabled) -``` - -##### `onlyif` - -If this parameter is set, then this `cli` will run unless this command condition is met. Example: - -``` -(result == true of /subsystem=datasources/data-source=ExampleDS:read-attribute(name=enabled) -``` - -#### Defined type: `wildfly::deployment` - -Manages a deployment (JAR, EAR, WAR) in Wildfly. This define is a wrapper for `wildfly_deployment` that defaults to your local Wildfly installation. - -#### Parameters within `wildfly::deployment` - -##### `name` - -The actual name of the deployment. (e.g. `hawtio.war` or `myapp.ear`) - -##### `ensure` - -Whether the deployment should exist (`present`) or not (`absent`). Default `present`. - -##### `source` - -Sets the source for this deployment, either a local file `file:/` or a remote file `http://`. - -##### `timeout` - -Sets the timeout to deploy this resource. Default `300`. - -##### `server_group` - -Sets the target `server-group` for this deployment. Requires domain mode. Default `undef`. - -##### `operation_headers` - -Sets [operation-headers](https://docs.jboss.org/author/display/WFLY9/Admin+Guide#AdminGuide-OperationHeaders) (e.g. `{ 'allow-resource-service-restart' => true, 'rollback-on-runtime-failure' => false, 'blocking-timeout' => 600}`) to be used when creating/destroying this deployment. Default `{}`. - -#### Defined type: `wildfly::reload` - -Performs a system reload when a reload is required `server-state=reload-required`. This define is a wrapper for `wildfly_restart` that defaults to your local Wildfly installation. It is commonly used as a subscriber of a resource that requires reload. - -#### Parameters within `wildfly::reload` - -##### `retries` - -Sets the number of retries to check if service is available. Default `3`. - -##### `wait` - -Sets the amount of time in seconds that this resource will wait for the service to be available before a attempt. Default `10`. - -#### Defined type: `wildfly::restart` - -Performs a full restart system when a restart is required `server-state=restart-required`. This define is a wrapper for `wildfly_restart` that defaults to your local Wildfly installation. It is commonly used as a subscriber of a resource that requires restart. - -#### Parameters within `wildfly::restart` - -##### `retries` - -Sets the number of retries to check if service is available. Default `3`. - -##### `wait` - -Sets the amount of time in seconds that this resource will wait for the service to be available before a attempt. Default `10`. - -#### Defined type: `wildfly::patch::offline` - -Applies patches offline. - -#### Parameters within `wildfly::patch::offline` - -##### `name` - -Sets the version of the patch to ensure that patch is present. - -##### `override_all` - -Whether it should solve all conflicts by overriding current files. Default `false`. - -##### `override` - -List of files to be overridden. Default `[]`. - -##### `preserve` - -List of files to be preserved. Default `[]`. - -#### Defined type: `wildfly::patch::online` - -Applies patches online. Requires server restart. - -#### Parameters within `wildfly::patch::online` - -##### `name` - -Sets the version of the patch to ensure that patch is present. - -##### `override_all` - -Whether it should solve all conflicts by overriding current files. Default `false`. - -##### `override` - -List of files to be overridden. Default `[]`. - -##### `preserve` - -List of files to be preserved. Default `[]`. - -#### Defined type: `wildfly::config::module` - -Manages a module (`$WILDFLY_HOME/modules`). - -#### Parameters within `wildfly::config::module` - -##### `name` - -The name of the module. e.g. `org.postgresql` - -##### `source` - -Sets the source for this module, either a local file `file:/`, a remote one `http://` or `puppet://`. - -##### `dependencies` - -Sets the dependencies for this module e.g. `javax.transaction`. Default `[]` - -##### `system` - -Whether this is a system (`system/layers/base`) module or not. Default `true`. - -#### Defined type: `wildfly::config::app_user` - -Manages an Application User (`application-users.properties`) for Wildfly. - -#### Parameters within `wildfly::config::app_user` - -##### `name` - -The user name. - -##### `password` - -The user password. - -#### Defined type: `wildfly::config::mgmt_user` - -Manages a Management User (`mgmt-users.properties`) for Wildfly. - -#### Parameters within `wildfly::config::mgmt_user` - -##### `name` - -The user name. - -##### `password` - -The user password. - -#### Defined type: `wildfly::config::user_groups` - -Manages groups for a Management User (`mgmt-groups.properties`). - -#### Parameters within `wildfly::config::user_groups` - -##### `name` - -The target user to manage groups. - -##### `groups` - -List of groups to associate with this user. - -#### Defined type: `wildfly::config::user_roles` - -Manages roles for an Application User (`application-roles.properties`). - -#### Parameters within `wildfly::config::user_roles` - -##### `name` - -The target user to manage roles. - -##### `groups` - -List of roles to associate with this user. - -> **NOTE:** Check [types tab](https://forge.puppet.com/biemond/wildfly/types) for more information about custom types/providers. - ## Limitations Some of this module public defined types (`widfly::datasources`, `wildfly::messaging`, `wildfly::undertow`, etc) are built for Wildfly 8.x and may not work with other versions. When there is a proven alternative for a different version, examples might be provided, otherwise you'll need to build your own abstraction using `wildfly_resource` or `wildfly::resource`. diff --git a/lib/puppet/type/wildfly_cli.rb b/lib/puppet/type/wildfly_cli.rb index 6cb6b2cb..0d5b2d01 100644 --- a/lib/puppet/type/wildfly_cli.rb +++ b/lib/puppet/type/wildfly_cli.rb @@ -1,5 +1,5 @@ Puppet::Type.newtype(:wildfly_cli) do - @doc = 'Executes JBoss-CLI commmands' + desc 'Executes JBoss-CLI commmands' @isomorphic = false diff --git a/lib/puppet/type/wildfly_deployment.rb b/lib/puppet/type/wildfly_deployment.rb index 5f1fc01e..73f2759f 100644 --- a/lib/puppet/type/wildfly_deployment.rb +++ b/lib/puppet/type/wildfly_deployment.rb @@ -1,7 +1,7 @@ require 'digest' Puppet::Type.newtype(:wildfly_deployment) do - @doc = 'Manages JBoss deployment' + desc 'Manages JBoss deployment' ensurable do defaultvalues diff --git a/lib/puppet/type/wildfly_resource.rb b/lib/puppet/type/wildfly_resource.rb index 2619b696..6f5fa58f 100644 --- a/lib/puppet/type/wildfly_resource.rb +++ b/lib/puppet/type/wildfly_resource.rb @@ -1,7 +1,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/wildfly/hash')) Puppet::Type.newtype(:wildfly_resource) do - @doc = 'Manages JBoss resources like datasources, messaging, ssl, modcluster, etc' + desc 'Manages JBoss resources like datasources, messaging, ssl, modcluster, etc' ensurable do defaultvalues diff --git a/lib/puppet/type/wildfly_restart.rb b/lib/puppet/type/wildfly_restart.rb index b3bca027..ba7fef5f 100644 --- a/lib/puppet/type/wildfly_restart.rb +++ b/lib/puppet/type/wildfly_restart.rb @@ -1,5 +1,5 @@ Puppet::Type.newtype(:wildfly_restart) do - @doc = 'Manage JBoss restarts.' + desc 'Manage JBoss restarts.' newparam(:name, :namevar => true) do desc 'Informational name' diff --git a/metadata.json b/metadata.json index 332b7aa5..6e7d086f 100644 --- a/metadata.json +++ b/metadata.json @@ -3,11 +3,11 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">=4.13.1 <5.0.0" + "version_requirement": ">=4.13.1 < 5.0.0" }, { "name": "jethrocarr/initfact", - "version_requirement": ">=1.0.1 <2.0.0" + "version_requirement": ">=1.0.1 < 2.0.0" } ], "license": "Apache-2.0", @@ -15,7 +15,7 @@ "project_page": "https://github.com/biemond/biemond-wildfly", "source": "https://github.com/biemond/biemond-wildfly", "summary": "Install, configure and manage Wildfly (8/9/10), JBoss EAP (6.1+/7.0+) and some Wildfly based products like apiman, Keycloak anInfinispan.", - "version": "1.2.7", + "version": "2.0.0", "tags": [ "jboss", "wildfly",