cookbook 'manage_services', '= 0.1.3'
manage_services (13) Versions 0.1.3 Follow1
Manage system services through attributes while providing all service resource options provided by Chef.
cookbook 'manage_services', '= 0.1.3', :supermarket
knife supermarket install manage_services
knife supermarket download manage_services
manage_services
Manage system services through attributes while providing all service resource options provided by Chef.
Usage
manage_services::default
Just include manage_services
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[manage_services]" ] }
Then move on to filling out some attributes.
Attributes
Ignore Failures
This set the ignore_failures default value for each service you define.
Default Value:
false
Ruby usage:
node['manage_services']['ignore_failures'] = true
JSON usage:
{ "manage_services": { "ignore_failures": true } }
Services
The set of services that you intend to manage.
Ruby usage:
node['manage_services']['services'] = [ "nscp" => [ "action" => ['enable', 'start'], "ignore_failure" => false, # Overriding the global settings set earlier "retries" => 3, "retry_delay" => 5, "timeout" => 30, "notifies" => [ "action" => "some_action", "resource" => "some[resource]", "timer" => "immediate" ], "subscribes" => [ "action" => "some_action", "resource" => "some[resource]", "timer" => "immediate" ], "supports" => [ "restart" => false, "reload" => false, "status" => true ] ] ]
JSON usage:
{ "manage_services": { "services": { "nscp": { "action": ["enable", "start"], "ignore_failure": false, "retries": 3, "retry_delay": 5, "timeout": 30, "notifies": { "action": "some_action", "resource": "some[resource]", "timer": "immediate" }, "subscribes": { "action": "some_action", "resource": "some[resource]", "timer": "immediate" }, "supports": { "restart": false, "reload": false, "status": true } } } } }
Service Caveats:
Note: The action
, notifies
, subscribes
, and supports
directives are defined differently here than they would be when calling the directives directly within a service resource in ruby.
The
action
directive should always be defined as an array of strings, even if only one action is desired. If noaction
is supplied this will be interpreted as:nothing
and a warning will be thrown.The
notifies
directive should always be defined as an object with string properties. It will be converted into the correct format within the default recipe.The
subscribes
directive should always be defined as an object with string properties. It will be converted into the correct format within the default recipe.The
supports
directive should always be defined as an object with boolean properties. It will be converted into the correct format within the default recipe.
All available service properties are defined in the Chef docs and their types remain the same besides the four mentioned above.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.1.3 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Foodcritic Metric
0.1.3 passed this metric
License Metric
0.1.3 passed this metric
0.1.3 failed this metric
0.1.3 passed this metric
License Metric
0.1.3 passed this metric
0.1.3 passed this metric