Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

wildfly (31) Versions 2.1.0

Installs/Configures wildfly

Policyfile
Berkshelf
Knife
cookbook 'wildfly', '= 2.1.0', :supermarket
cookbook 'wildfly', '= 2.1.0'
knife supermarket install wildfly
knife supermarket download wildfly
README
Dependencies
Changelog
Quality 83%

Wildfly Cookbook

Cookbook to deploy the WildFly Java Application Server

Cookbook
Build Status
Gitter chat

Provides resources for installing/configuring WildFly and managing WildFly service instances for use in wrapper cookbooks. Installs WildFly from tarball and installs the appropriate configuration for your platform's init system.

Requirements

Platforms

  • RHEL and derivatives
  • Ubuntu

Chef

  • Chef 12.19+

Usage

This cookbook has recently been rewritten to be resource-driven. It was a large undertaking and breaks old behavior, hence the major version bump. The API-driven configuration and deployment resources are much faster to converge.

The old recipes were kept around for similar, legacy behavior, but using the resources directly in your wrapper cookbook will yield more flexibility.

Example wrapper cookbook scenarios are available in the test cookbook, under test/fixtures/cookbooks/test

Attributes

  • node['wildfly']['version'] - Specify the version of Wildfly
  • node['wildfly']['url'] - URL to WildFly tarball
  • node['wildfly']['checksum'] - SHA256 hash of said tarball

Recipes

  • ::default - Installs WildFly and any enabled connectors.
  • ::install - Installs WildFly using the wildfly resource
  • ::mysql_connector - Installs MySQL Connector/J
  • ::postgres_connector - Installs PostgreSQL Java connector

Resource Providers

WildFly

  • Installs and configures WildFly.
wildfly_wildfly 'wildfly' do
  mode 'standalone' # => WildFly Mode
  config 'standalone-full.xml' # => The WildFly Configuration File
  base_dir '/opt/wildfly' # => Directory to install WildFly to
  service_user 'wildfly'
  service_group 'wildfly'
  provision_user true # => Whether to create the WildFly service user/group
  create_mgmt_user true # => Provision a random, secure user for API interactions
  url 'http://.../wildfly.tar.gz' # URL to WildFly tarball to download
  checksum 'SHA256_CHECKSUM' # WildFly Tarball Checksum
  version '1.2.3' # Version of WildFly (Should correspond to URL)
end
Accessor Properties
  • bind_management_http - the HTTP port for the Management Interface & API

Resource

  • Flexible resource which allows provisioning of attributes and their parameters via the WildFly Management API. This should be used over other resources as it affords more flexibility.
wildfly_resource 'Syslog Handler' do
  path ['subsystem', 'logging', 'syslog-handler', 'SYSLOG']
  parameters 'app-name' => 'TEST',
             'enabled'  => true,
             'hostname' => 'localhost',
             'level'    => 'ALL',
             'port'     => 514,
             'server-address' => 'test.syslog.local',
             'syslog-format'  => 'RFC5424'
  action :create
end

Deploy API

  • Resource to deploy applications via the API
# => URL-Based Deployment
wildfly_deploy_api 'Sample' do
  deploy_name 'sample-v1'
  runtime_name 'sample.war'
  parameters 'url' => 'https://github.com/apcera/sample-apps/raw/master/example-java-war/sample.war'
end
# => File-Based Deployment
myapp = remote_file 'helloworld' do
  source 'https://github.com/efsavage/hello-world-war/raw/master/dist/hello-world.war'
  path ::File.join(Chef::Config[:file_cache_path], 'hello-world.war')
  mode '0644'
  action :create
end

wildfly_deploy_api 'HelloWorld File Deployment' do
  deploy_name "HelloWorld-file-V1"
  runtime_name 'helloworld-file.war'
  parameters 'url' => 'file://' + myapp.path
end

Legacy Resources

  • These will be deprecated in the future. The wildfly_resource resource can do everything these can, and via the much faster Management API. The deploy_api resource will replace the deploy resource as well.

Datasource

wildfly_datasource 'example' do
  jndiname 'java:jboss/datasource/example'
  drivername 'some-jdbc-driver'
  connectionurl 'jdbc:some://127.0.0.1/example'
  username 'db_username'
  password 'db_password'
  sensitive false
end

Deploy

Allows you to deploy JARs and WARs via chef

From a URL

wildfly_deploy 'jboss.jdbc-driver.sqljdbc4_jar' do
      url 'http://artifacts.company.com/artifacts/mssql-java-driver/sqljdbc4.jar'
end

From File

wildfly_deploy 'jboss.jdbc-driver.sqljdbc4_jar' do
      path '/opt/resources/sqljdb4.jar'
end

With Automated Update

Requires a common runtime_name and version-specific name
ruby
wildfly_deploy 'my-app-1.0.war' do
url 'http://artifacts.company.com/artifacts/my-app.1.0.war'
runtime_name 'my-app.war'
end

Undeploy

Use :disable to keep the contents, and :enable to re-deploy previously kept contents
ruby
wildfly_deploy 'jboss.jdbc-driver.sqljdbc4_jar' do
action :remove
end

Attribute LWRP

Allows you to set an attribute in the server config

Example

<server name="default-server">
  <http-listener name="default" socket-binding="http" max-post-size="20971520"/>
  <host name="default-host" alias="localhost">

Adjust max-post-size

wildfly_attribute 'max-post-size' do
   path '/subsystem=undertow/server=default-server/http-listener=default'
   parameter 'max-post-size'
   value '20971520L'
   notifies :restart, 'service[wildfly]', :delayed
end

Add Attribute

wildfly_attribute 'max-post-size' do
   path '/subsystem=mail/mail-session="postbox"'
   parameter 'jndi-name="java:/mail/postbox",debug=true'
   action :add
end

Property LWRP

Allows you to set or delete system properties in the server config. (Supported Actions: :set, :delete)

wildfly_property 'Database URL' do
   property 'JdbcUrl'
   value 'jdbc:mysql://1.2.3.4:3306/testdb'
   action :set
   notifies :restart, 'service[wildfly]', :delayed
end

Authors

Author:: Brian Dwyer - Intelligent Digital Services

Contributors

Contributor:: Hugo Trippaers

Contributor:: Ian Southam

WildFly Cookbook CHANGELOG

2.1.0 (2018-10-28)

  • WildFly 14.0.1
  • Bump MySQL ConnectorJ to 8.0.13
  • Bump Postgres Connector to 42.2.5
  • Adjust datasource logic
  • Update test framework JDK to 8u191

2.0.1 (2018-8-7)

  • Cleanup deprecated attributes and update resources
  • Update documentation

2.0.0 (2018-8-6)

  • WildFly 13.0.0
  • Remove Java cookbook dependency -- Bring your own Java
  • Remove unnecessary apt & yum dependencies

1.1.0 (2018-5-28)

  • WildFly 12.0.0
  • Update Java to 8u171
  • Add support for Ubuntu on the Supermarket
  • Bump minimum supported Chef version due to Chef 12 and compat_resource deprecation
  • Adjust tests for CLI deploy resource seemingly ignoring --name when --url is specified in 12.0.0 (Works fine via API)

1.0.1 (2018-2-6)

  • Update README
  • Add support for Ubuntu on the Supermarket

1.0.0 (2018-2-6)

  • Rewrite as Resource-Driven Cookbook for added flexibility in deployment
  • Add resources for API-based configuration & deployment
  • WildFly 11
  • Adjust configuration to be primarily based on Java Properties and Launch Configuration. This means we've removed XML template-driven configuration... The templates were simply clunky and not the ideal way to handle WildFly configuration.

0.4.3 (2018-1-5)

  • Fix Chef version constraint in metadata

0.4.2 (2017-12-15)

  • WildFly 10.1
  • Add ability to add attributes
  • Allow better control of ShellEscape for wildfly_property resource
  • Fix for SystemD
  • Only deploy Domain configuration in domain mode

0.3.1 (2016-04-11)

  • Chef will override sensitive back to its global value

0.3.0 (2016-02-24)

  • Add sensitive and optional username/password parameters to datasource resource.
  • Fix missing jboss.jdbc-driver.mysql by restarting Wildfly immediately after installing mysql_connector.
  • Add ChefSpec Matchers.

0.2.0 (2015-09-09)

  • Make install of Java optional.

0.1.19 (2015-04-01)

  • Fixed location of wildfly.conf in Debian init script.

0.1.18 (2015-03-19)

  • Adjusted behavior of the service user update procedure.
    • Fixed hardcoded username.
    • Adjusted logic to not fail if user is changed or does not exist... DO NOT CHANGE THE USER AFTER DEPLOYMENT!
    • Touch markerfile if conditions warrant user change.
  • Added CHANGELOG.md

0.1.17 (2015-03-16)

  • Adjusted WildFly service user behavior. We now create a system account (UID reserved range), set home directory to WildFly's base directory, and assign the /sbin/nologin shell
    • Existing installations will only have the home directory and login shell changed, WildFly service will be stopped in order to facilitate this!
  • Brought standalone.conf and domain.conf outside of configuration enforcement
  • Bumped Java JDK to 8u40

0.1.16 (2015-02-04)

  • Added support for provisioning domain.conf
  • Added ability to set port binding offset
  • Switched to JDK8 by default due to JDK7 deprecation
  • Bumped MySQL Connector/J to 5.1.34

0.1.15 (2014-11-26)

  • Bump for WildFly 8.2.0-FINAL

0.1.14 (2014-10-22)

  • Fixed PostGRES support and added XA datasource support
  • Bumped Java JDK to 7u71
  • Bumped MySQL Connector/J to 5.1.33

0.1.13 (2014-10-22)

  • Added support for Debian
    • Contributed by atoulme
  • Added support for PostGRES
    • Contributed by atoulme

0.1.12 (2014-09-18)

  • Code cleanup
    • Contributed by rdoorn and bjbishop

0.1.11 (2014-09-02)

  • Adjusted MySQL Connector/J deployment to restart WildFly upon Connector/J update
  • Bumped MySQL Connector/J to 5.1.32

0.1.10 (2014-08-25)

  • Updated deploy provider (Contributed by rdoorn)
    • Added undeploy (:remove) action
    • Allow to specify runtime_name
    • Automatically deploy new versions of war from URL based on common runtime_name (See README for deploy provider, example 3)
    • Bumped Java JDK to 7u67

0.1.9 (2014-06-25)

  • Set WildFly service resource to run at startup
  • Added logcategory and loghandler LWRP's (Contributed by afornie)

0.1.8 (2014-06-06)

  • Added properties LWRP to deploy WildFly system properties
  • Added logrotate functionality

0.1.7 (2014-06-02)

  • Bump for WildFly 8.1.0-FINAL
  • Bumped Java JDK to 7u60

0.1.6 (2014-05-19)

  • Bump for WildFly 8.1.0-CR2

0.1.5 (2014-05-08)

  • Allow the addition of application users and roles (Contributed by isoutham)
  • Bug fix to datasource and deploy providers to specify shell, as /sbin/nologin should be used for service user in Production (Contributed by isoutham)
  • Rubocop and FoodCritic fixes (Contributed by isoutham)

0.1.4 (2014-05-07)

  • Added a provider for updating configuration attributes (Contributed by isoutham)

0.1.3 (2014-04-16)

  • Bumped Java JDK to 7u55

0.1.2 (2014-04-16)

  • Bug fix in templates

0.1.1 (2014-04-16)

  • Bump for WildFly 8.1.0-CR1

0.1.0 (2014-02-18)

  • Initial commit

Collaborator Number Metric
            

2.1.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

2.1.0 passed this metric

Foodcritic Metric
            

2.1.0 passed this metric

No Binaries Metric
            

2.1.0 passed this metric

Testing File Metric
            

2.1.0 passed this metric

Version Tag Metric
            

2.1.0 passed this metric