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

manage_services (13) Versions 0.1.4

Manage system services through attributes while providing all service resource options provided by Chef.

Policyfile
Berkshelf
Knife
cookbook 'manage_services', '= 0.1.4', :supermarket
cookbook 'manage_services', '= 0.1.4'
knife supermarket install manage_services
knife supermarket download manage_services
README
Dependencies
Quality 67%

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 no action 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.4 failed this metric

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

Foodcritic Metric
            

0.1.4 passed this metric

License Metric
            

0.1.4 passed this metric