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


ovh-api (7) Versions 2.1.0

Configure and control your servers on OVH by its API

cookbook 'ovh-api', '= 2.1.0'
cookbook 'ovh-api', '= 2.1.0', :supermarket
knife cookbook site install ovh-api
knife cookbook site download ovh-api
Quality 33%



Use OVH API to configure your servers, domains, etc. hosted by OVH. It includes an Ohai plugin used to load OVH information in automatic attributes.

At the moment, this cookbook can configures the firewall associated to an IP and the ohai plugin loads the hardware specifications.


Cookbooks and gems

Declared in metadata.rb and in Gemfile.


  • Should work on every GNU/Linux and may even work on Windows
  • Tested on RHEL Family 7 (centos 7.2)



First, you should get an application key, an application secret and a consumer key with the necessary rights from OVH. More information on

Then you have to create an encrypted data bag containing these keys. By default this data bags is named secrets and its item containing the OVH keys is ovh-keys. Its decrypted content should be like:

  "id": "ovh-keys",
  "app_key": "my_app_key",
  "app_secret": "my_app_secret",
  "consumer_key": "my_consumer_key"

Finally do not forget to place the secret keys on the servers.

To verify your setup, add recipe[ovh-api::init] in your runlist. If it converges, your authentification with OVH is correctly configured.

An example of setup is given in test/integration/default directory.


Add recipe[ovh-api::firewall] in your run-list to configure the OVH firewall for this server. You can configure each IP associated to this server. The default one can be named primary.

Then for each IP, you can enable or disable the firewall and manage the rules. The configuration syntax is the same as OVH API, for which you can find the documentation at

Finally, you can find an example in .kitchen.yml.


Add recipe[ovh-api::ohai] in your run-list to install and load the Ohai plugin. It will fetch different information and put them in node['ovh'].


This cookbook is tested in kitchen with the help of webmock to intercept the HTTP REST calls.

It uses a test cookbook webmock by setting recipe[webmock::stubs] and recipe[webmock::verify] in the runlist: stubs recipe initializes webmock and create the necessarily stubs while verify recipe dumps all calls so they can later be checked by serverspec.

For more information, see .kitchen.yml and test directory.


Configuration is done by overriding default attributes. All configuration keys have a default defined in attributes/default.rb. Please read it to have a comprehensive view of what and how you can configure this cookbook behavior.

Note: for fields needing an IP address, it is possible to set an interface name, which will be resolved to its first non-local address.



Include all other recipes except init and ohai.


Initialize the OVH client.


Configure the firewall according to node['ovh-api']['firewall'].


Install and load the Ohai plugin, add OVH information about the server in node['ovh'].




Available in CHANGELOG.


Please read carefully before making a merge request.

License and Author

Copyright (c) 2015-2016 Sam4Mobile

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

ohai >= 4.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.




  • Fix idempotence in firewall rules containing port configurations



  • Work with ohai cookbook >= 4.x


  • Work with webmock >= 2.x
  • Strengthen gitlab-ci tests
    • remove previous container correctly
    • add silence option to curl calls
    • destroy containers even if tests fail
  • Deactivate kitchen-docker_cli preparation (use image directly)



  • Create OVH firewall for the server if needed and wait for it (55s max)


  • Switch kitchen driver to docker_cli
  • Remove all platforms but centos and use prepared docker image
  • Define Continuous Integration configuration with gitlab-ci


  • Fix rubocop offenses
  • Rename CHANGELOG -> and fix markdown
  • Fix Gemfile, need k-docker_cli instead of k-docker



  • Fix service_name detection, check all ips, not just eth0
  • Create an Ohai plugin to add OVH information in node['ovh']:
    • service_name, service name as defined in the interface
    • primary_ip, static ip attributed by OVH
    • primary_iface, network interface on which the primary ip is defined
    • vrack_iface, network interface reserved for vrack
    • hardware, from /specifications/hardware Install it by adding recipe['ovh-api::ohai'] in your runlist


  • Standardize docker images among cookbooks
    • Create an universal image for centos/debian/ubuntu
  • Fix all rubocop offenses


  • Initial version with firewall configuration (/ip/firewall)
  • Should work almost everywhere but tested on Centos 7, Debian 8 and Ubundu 1404

Collaborator Number Metric

2.1.0 failed this metric

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

Contributing File Metric

2.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

2.1.0 failed this metric

FC066: Ensure chef_version is set in metadata: ovh-api/metadata.rb:1
Run with Foodcritic Version 10.2.2 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric

2.1.0 failed this metric

ovh-api does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, MIT, mit, GPL-2.0, gplv2, GPL-3.0, gplv3.

No Binaries Metric

2.1.0 passed this metric

Publish Metric

2.1.0 passed this metric

Supported Platforms Metric

2.1.0 passed this metric

Testing File Metric

2.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

2.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number