cookbook 'chef-consul', '~> 1.0.0'
chef-consul (1) Versions 1.0.0 Follow2
Installs chef-consul.
cookbook 'chef-consul', '~> 1.0.0', :supermarket
knife supermarket install chef-consul
knife supermarket download chef-consul
Chef Consul
Chef Consul is a Gem & Chef Recipe that includes extensions to chefs node object that allows easy interaction with consul leveraging Diplomat.
Installation
If you want to develop/hack on chef-consul, please see the CONTRIBUTING.md.
If you are using Berkshelf, add chef-consul
to your Berksfile
:
cookbook 'chef-consul'
Otherwise, you can use knife
or download the tarball directly from the community site:
knife cookbook site install chef-consul
Usage
In order to use Chef Consul in your Chef Recipes, you'll first need to include it:
include_recipe 'chef-consul::default'
Alternatively you can put it in a base role or recipe and it will be included subsequently.
Requiring the Chef Consul Gem will automatically extend the node object with consul methods.
API
Note: For the most extensive API documentation, please see the YARD documentation.
Node
Additional methods for the node
object
-
first_service(name)
- fetch the first node in a service. -
all_services(name)
- fetch all nodes in a service. -
get_consul_key(key, recursive = false)
- return the value of a key in consul. -
put_consul_key(key, value)
- write a value to a key in consul
Examples
services = node.all_services('consul') # => [#<OpenStruct Node="consul0", Address="1.2.3.4", ServiceID="consul", ServiceName="consul", ServiceTags=["consul"], ServicePort=8300>,#<OpenStruct Node="consul1", Address="1.2.3.5", ServiceID="consul", ServiceName="consul", ServiceTags=["consul"], ServicePort=8300>]
node.put_consul_key('test', 'value') # => "value"
License & Authors
- Author: Sam Dunne (sam@sam-dunne.com)
Copyright 2015 Sam Dunne 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.
Chef Consul Changelog
This file is used to list changes made in each version of the chef-consul cookbook and gem.
v1.0.0 (2015-10-27)
- First public release
Collaborator Number Metric
1.0.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.0 failed this metric
FC064: Ensure issues_url is set in metadata: chef-consul/metadata.rb:1
FC065: Ensure source_url is set in metadata: chef-consul/metadata.rb:1
FC066: Ensure chef_version is set in metadata: chef-consul/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: chef-consul/metadata.rb:1
FC069: Ensure standardized license defined in metadata: chef-consul/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.0 passed this metric
Testing File Metric
1.0.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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.0 failed this metric
1.0.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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.0 failed this metric
FC064: Ensure issues_url is set in metadata: chef-consul/metadata.rb:1
FC065: Ensure source_url is set in metadata: chef-consul/metadata.rb:1
FC066: Ensure chef_version is set in metadata: chef-consul/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: chef-consul/metadata.rb:1
FC069: Ensure standardized license defined in metadata: chef-consul/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.0 passed this metric
Testing File Metric
1.0.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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.0 failed this metric
FC065: Ensure source_url is set in metadata: chef-consul/metadata.rb:1
FC066: Ensure chef_version is set in metadata: chef-consul/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: chef-consul/metadata.rb:1
FC069: Ensure standardized license defined in metadata: chef-consul/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
1.0.0 passed this metric
Testing File Metric
1.0.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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.0 failed this metric
1.0.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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number