cookbook 'spring-boot', '= 1.1.3'
spring-boot (13) Versions 1.1.3 Follow8
Installs/Configures spring-boot-app
cookbook 'spring-boot', '= 1.1.3', :supermarket
knife supermarket install spring-boot
knife supermarket download spring-boot
Spring Boot Chef Cookbook
This Chef cookbook provides a custom resource spring_boot_web_app to install and deploy Spring Boot
Applications. Currently only supports Spring Boot Web
Apps.
Also, will only work on systems with systemd
or init.d
(System V) based init systems.
For init.d
, the Spring Boot App must be configured
to be fully executable.
Log location can also not be set for init.d
and all
console logs will be written to /var/log/<appname>.log
This custom resource does not install java.
Java must be installed on the target node before using the custom resource spring_boot_web_app
To use it you have to include depends 'spring-boot'
in your metadata.rb
.
Syntax
This cookbook provides a custom resource named spring_boot_web_app
.
The simplest use of the spring_boot_web_app resource is:
spring_boot_web_app 'name_of_webapp' do
jar_remote_path 'http://example.com/path/to/your/jar/your_jar.jar'
end
which will download your artifact from jar_remote_path and create a "systemd" service listening on port 8080
started by the user bootapp
The full syntax for all of the properties that are available to the spring_boot_web_app resource is:
spring_boot_web_app 'name_of_webapp' do
notifies # see description
user String # defaults to bootapp
group String # defaults to bootapp
port Integer # defaults to 8080
jar_remote_path String
java_opts String
boot_opts String
properties Hash
repo_user String
repo_password String
init_system String # defaults to systemd
wait_for_http [TrueClass, FalseClass] # defaults to true
wait_for_http_retries Integer # defaults 24
wait_for_http_retry_delay Integer # defaults 5
subscribes # see description
action Symbol # defaults to :install if not specified
end
where
-
user
- the user that runs the webappdefault: 'bootapp'
-
group
- the group the user who runs the web_app belongs todefault: 'bootapp'
` -
port
- the port that the web_app listens ondefault: 8080
-
jar_remote_path
- the location the jar_file is fetched from -
java_opts
- theJAVA_OPTS
the application is started with -
boot_opts
- theBOOT_OPTS
the application is started with -
properties
- a Hash that describes properties files -
repo_user
- the user if yourjar_remote_path
is protected by basic auth -
repo_password
- the password if yourjar_remote_path
is protected by basic auth -
init_system
- for nowsystemd
andinitd
are valid optionsdefault: 'systemd'
-
wait_for_http
- should chef wait for the webapp to answerdefault: true
-
wait_for_http_retries
- how many times should chef-client retrydefault: 24
-
wait_for_http_retry_delay
- how long should chef-client wait before each requestdefault: 5
-
jmx_credentials
- a hash that describes jmx_credentials
See "Properties" section below for more information about all of the properties that may be used with this resource.
Actions
This resource has the following actions:
:install
Default. Installs spring_boot_web_app from jar_remote_path
:uninstall
Removes previosly installed spring_boot_web_app instances
Properties
notifies
Ruby Type: Symbol, 'Chef::Resource[String]'
A resource may notify another resource to take action when its state changes. Specify a 'resource[name]'
, the :action
that resource should take, and then the :timer
for that action. A resource may notify more than one resource; use a notifies
statement for each resource to be notified.
A timer specifies the point during the chef-client run at which a notification is run. The following timers are available:
:before
Specifies that the action on a notified resource should be run before processing the resource block in which the notification is located.
:delayed
Default. Specifies that a notification should be queued up, and then executed at the very end of the chef-client run.
:immediate
, :immediately
Specifies that a notification should be run immediately, per resource notified.
The syntax for notifies
is:
notifies :action, 'resource[name]', :timer
properties
Ruby Type: Hash
Optional. The keys on the toplevel of the hash are the filename of a properties file postfixed with .properties
the values of the toplevel keys are hashes containing key, value pairs that are written out to the file - for example:
{ 'app_1_initd' => { 'a' => '5', 'b' => '10' }, 'other_properties' => { 'c' => '25'} }
would create two properties files:
file | content |
---|---|
app_1_initd.properties |
a=5 b=10
|
other_properties.properties |
c=25 |
jmx_credentials
Ruby Type: Hash
Optional. the keys on the toplevel are the usernames their values are hases containing a password
and access
key.
- for example:
{ 'monitorRole' => { 'password' => 'monitor', 'access' => 'readonly'} }
would create the two files jmxremote.access and jmxremote.password as follows:
# jmxremote.access
monitorRole readonly
# jmxremote.password
monitorRole monitor
Examples
Examples can be found in test/fixtures/cookbooks/fake/recipes/
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
spring-boot CHANGELOG
1.0.0
- JonsJava
- Cleaned up recipes, added new features that Chef now expects, broke example recipes into fake cookbook.
- goblin23
- Converted LWRP into a custom ressource
- Removed dependency to the java cookbook
1.1.0
- Khorchammar
- Added jmx configuration
1.1.1
- JonsJava
- Very minor tweak to the README.md to ensure that the Multi-Dimensional array is Cookstyle-compliant. (spaces before closing
}
)
1.1.2
- frank-carnovale Set current working directory in service definition template
- goblin23 removed kind_of statements from custom ressource
Collaborator Number Metric
1.1.3 failed this metric
Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.1.3 passed this metric
Foodcritic Metric
1.1.3 passed this metric
No Binaries Metric
1.1.3 passed this metric
Testing File Metric
1.1.3 passed this metric
Version Tag Metric
1.1.3 passed this metric
1.1.3 failed this metric
1.1.3 passed this metric
Foodcritic Metric
1.1.3 passed this metric
No Binaries Metric
1.1.3 passed this metric
Testing File Metric
1.1.3 passed this metric
Version Tag Metric
1.1.3 passed this metric
1.1.3 passed this metric
1.1.3 passed this metric
Testing File Metric
1.1.3 passed this metric
Version Tag Metric
1.1.3 passed this metric
1.1.3 passed this metric
1.1.3 passed this metric