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

ovh-api (6) Versions 1.0.0

Configure and control your servers on OVH by its API

Berkshelf/Librarian
Policyfile
Knife
cookbook 'ovh-api', '= 1.0.0'
cookbook 'ovh-api', '= 1.0.0', :supermarket
knife cookbook site install ovh-api
knife cookbook site download ovh-api
README
Dependencies
Changelog
Quality

OVH API

Description

Use OVH API to configure your servers, domains, etc. hosted by OVH.

At the moment, this cookbook only configures the firewall associated to an IP.

Requirements

Cookbooks and gems

Declared in metadata.rb and in Gemfile.

Platforms

  • Should work on every GNU/Linux and may work on Windows
  • Tested on RHEL Family 7, Debian 8 and Ubuntu 14.04

Usage

Prerequisite

First, you should get an application key, an application secret and a consumer key with the necessary rights from OVH. More information on https://api.ovh.com/g934.first_step_with_api.

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.

Firewall

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 https://api.ovh.com/console.

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

Test

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.

Attributes

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.

Recipes

default

Include all other recipes.

init

Initialize the OVH client.

firewall

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

Resources/Providers

None.

Changelog

Available in CHANGELOG.

Contributing

Please read carefully CONTRIBUTING.md before making a merge request.

License and Author

Copyright:: 2015, 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

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

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

Foodcritic Metric
            

1.0.0 passed this metric