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

RSS

manage_services (13) Versions 1.1.1

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

Berkshelf/Librarian
Policyfile
Knife
cookbook 'manage_services', '= 1.1.1'
cookbook 'manage_services', '= 1.1.1', :supermarket
knife cookbook site install manage_services
knife cookbook site download manage_services
README
Dependencies
Quality

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
            

1.1.1 failed this metric

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

Foodcritic Metric
            

1.1.1 passed this metric

License Metric
            

1.1.1 passed this metric

Publish Metric
            

1.1.1 passed this metric

Supported Platforms Metric
            

1.1.1 passed this metric