cookbook 'wildfly', '= 0.1.18'
wildfly
(31) Versions
0.1.18
-
Follow13
Installs/Configures wildfly
cookbook 'wildfly', '= 0.1.18', :supermarket
knife supermarket install wildfly
knife supermarket download wildfly
Wildfly Cookbook
Cookbook to deploy Wildfly Java Application Server
Requirements
Chef Client 11+
Java Opscode Community Cookbook
Platform
- CentOS, Red Hat
Tested on:
- CentOS 6.6
Usage
You can add users in the proper format to attributes\users.rb
You can customize the Java version, and the Connector/J if you'd like.
If running in production, I STRONGLY recommend you use a wrapper cookbook, and manually specify the Wildfly version, Java version, and cookbook version as well. This cookbook and configuration templates will continually be updated to support the latest stable release of Wildfly. Currently, version upgrades will trigger configuration enforcement, meaning any changes made outside of Chef will be wiped out.
Attributes
node['wildfly']['base']
- Base directory to run Wildfly fromnode['wildfly']['version']
- Specify the version of Wildflynode['wildfly']['url']
- URL to Wildfly tarballnode['wildfly']['checksum']
- SHA256 hash of said tarballnode['wildfly']['user']
- User to run Wildfly as. DO NOT MODIFY AFTER INSTALLATION!!!node['wildfly']['group']
- Group which owns Wildfly directoriesnode['wildfly']['server']
- Name of service and init.d script for daemonizingnode['wildfly']['mysql']['enabled']
- Boolean indicating Connector/J supportnode['wildfly']['int'][*]
- Various hashes for setting interface & port bindingsnode['wildfly']['smtp']['host']
- SMTP Destination hostnode['wildfly']['smtp']['port']
- SMTP Destination port
Recipes
-
::default
- Installs Java & Wildfly. Also installs Connector/J if you've got it enabled. -
::install
- Installs Wildfly. -
::mysql_connector
- Installs Connector/J into appropriate Wildfly directory.
Providers
Datasource LWRP
wildfly_datasource 'example' do jndiname "java:jboss/datasource/example" drivername "some-jdbc-driver" connectionurl "jdbc:some://127.0.0.1/example" end
Deploy LWRP
Allows you to deploy JARs and WARs via chef
Example 1 (from a url)
ruby
wildfly_deploy 'jboss.jdbc-driver.sqljdbc4_jar' do
url "http://artifacts.company.com/artifacts/mssql-java-driver/sqljdbc4.jar"
end
Example 2 (from disk)
ruby
wildfly_deploy 'jboss.jdbc-driver.sqljdbc4_jar' do
path "/opt/resources/sqljdb4.jar"
end
Example 3 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
Example 4 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
To change the max-post-size parameter
```xml
<server name="default-server">
<http-listener name="default" socket-binding="http" max-post-size="20971520"/>
<host name="default-host" alias="localhost">
```ruby
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]"
end
If the attribute restart is set to false, the wildfly will never restart
wildfly_attribute "max-post-size" do path "/subsystem=undertow/server=default-server/http-listener=default" parameter "max-post-size" value "20971520L" restart false 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
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
- Contributed by
- Added support for PostGRES
- Contributed by
atoulme
- Contributed by
0.1.12 (2014-09-18)
- Code cleanup
- Contributed by
rdoorn
andbjbishop
- Contributed by
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 byrdoorn
)- 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