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

consul-template (8) Versions 0.10.0

Installs/Configures consul-template

Policyfile
Berkshelf
Knife
cookbook 'consul-template', '= 0.10.0', :supermarket
cookbook 'consul-template', '= 0.10.0'
knife supermarket install consul-template
knife supermarket download consul-template
README
Dependencies
Changelog
Quality 100%

consul-template

Latest Version
Build Status
Coverage Status

Installs and configures consul-template.

Supported Platforms

  • Ubuntu 14.04, 12.04
  • Debian 8.2, 7.9, 6.0.10
  • Centos 7.2, 6.7
  • Arch Linux

Attributes

  • node['consul_template']['base_url'] - Base URL for consul-template binary files
  • node['consul_template']['version'] - Version of consul-template to install. Used to determine which binary to grab from the base_url.
  • node['consul_template']['install_method'] - How consul-template should be installed. Supports 'binary' or 'source'.
  • 'node['consul_template']['install_dir'] - Directory where consul-template should be installed.
  • node['consul_template']['checksums'] - Contains a hash of checksums where the key is the file for a given OS/architecture, and the value is the associated checksum. For example, consul-template_0.3.1_linux_amd64.
  • node['consul_template']['source_revision'] - When installing from source, this determines the revision it should use.
  • node['consul_template']['config_dir'] - The directory that contains the configuration files for consul-template.
  • node['consul_template']['init_style'] - Defines the init system that the consul-template service should use. Supports 'init', 'runit', or 'systemd'.
  • node['consul_template']['service_user'] - Defines the user that should be used for the consul-template service.
  • node['consul_template']['service_group'] - Defines the group that should be used for the consul-template service.
  • node['consul_template']['template_mode'] - File permissions mode for all consul-template configuration files.

Recipes

default

Installs and configures consul-template using the install method specified in
node['consul_template']['install_method'].

install_binary

Installs consul-template using one of the binaries provided by Hashicorp. It
will also verify the checksum. The default attributes includes the latest
version's binaries for all supported OS/architectures, including their
checksum.

install_source

Installs consul-template from source.

service

Installs and configures the consul-template service.

LWRP

consul_template_config

Creates configuration files in node['consul_template']['config_dir'], and
reloads the configuration.

For example, if you want to generate HAProxy's config using consul-template,
you may include something like this in your recipe:

consul_template_config 'haproxy' do
  templates [{
    source: '/etc/haproxy/haproxy.cfg.ctmpl',
    destination: '/etc/haproxy/haproxy.cfg',
    command: 'service haproxy restart'
  }]
  notifies :reload, 'service[consul-template]', :delayed
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Adding checksums for new versions

The attributes/checksums.rb file contains checksums for the current and past
consul-template versions. A quick and easy contribution you can make is to
update it when a new version of consul-template is released, as I'm not always
paying attention to when new versions come out.

In order to make this as easy and straightforward as possible, there is a helper
script (scripts/generate-checksums) that takes a version number, and returns
a pre-formatted list of the checkums (e.g. using version 0.10.0):

$ scripts/generate-checksums 0.10.0
Generating checksums for v0.10.0
'consul-template_0.10.0_darwin_386' => 'fb39f978f0e24175b7daee1f884e5299b11eb3a0689c37c7e96a26f9cadcbd77',
'consul-template_0.10.0_darwin_amd64' => '178e8e59d2e380440ac5582fb7f49c946ff931c1589ac85258d7dba82aefaabe',
'consul-template_0.10.0_freebsd_386' => '981b73d6547658d96bc5f2125dcc4161879c5c60c6eca3fa98b4a914f9f96581',
'consul-template_0.10.0_freebsd_amd64' => '0738c0887bb7ac2a879735ab61ea213ee042b5f53b27c6d26d4aa11f2bc6874a',
'consul-template_0.10.0_freebsd_arm' => '0488f76d3d0ca4b81ae807dfe7724b22380087adb5a4a49e73676095959e9f3c',
'consul-template_0.10.0_linux_386' => 'f9926eac99eb60ee1379e6f15a1d8240e96aa9076372914387005c8475d1e561',
'consul-template_0.10.0_linux_amd64' => 'ef298a2ae54cf51dbfc4108194299a9055b252ff9b917e7dd40c72fa30820096',
'consul-template_0.10.0_linux_arm' => '753b10added292b8873694d0f7905c4ddd62dd6bd3115f866ea5eee902d98f7c',
'consul-template_0.10.0_netbsd_386' => 'e1a6d759a91a2fa316af276c28643825727cd40ac214d12395ccfbbfad075f72',
'consul-template_0.10.0_netbsd_amd64' => '99a7cf3b3bb62968d99d627dc4419f584330484826b3e87f0bfcbe5b5d208c4b',
'consul-template_0.10.0_netbsd_arm' => 'da81d8bfbcb230e8492129dc0d2c5d50e1db651efdce355ec9697f20d8442b2a',
'consul-template_0.10.0_openbsd_386' => '7672b647c9af37e04513ddd4103856644361d20a8ab2a57ea0178f421db01a31',
'consul-template_0.10.0_openbsd_amd64' => 'af978a312dbae326e5aab2566d8a2549aae2910986580e4895fa276fffa98513',
'consul-template_0.10.0_windows_386' => '6611d9aa5bd9ae39d93690cbedb2bc8b57427dfe5a79774346292903282b698f',
'consul-template_0.10.0_windows_amd64' => 'cf88397f3abf6b1e6064672d0535db5d94ced04332e56a1f31f9a2456f30a041',

Just copy and paste it to the bottom of the hash in attributes/checksums.rb and that's it.

Consul Template Cookbook Changelog

v0.10.0 (February 25th, 2016)

IMPROVEMENTS:

  • Updates default version of consul-template to 0.12.2, updated release download location, adds new checksums. (GH-36) (GH-39) (GH-41)

BUG FIXES:

  • Fixes issue preventing consul-template from updating existing installs (GH-38)
  • Fixes issue causing a zero-length consul-template file being created in some situations (GH-40)
  • Fixes issue introduced in the GH-38 fix that prevented the install_binary recipe from running by itself. (GH-43)
  • Uses consul-template service user when using upstart. (GH-45)

v0.9.1 (November 19th, 2015)

BUG FIXES:

  • Removes quotes around perms in config template (GH-33)

v0.9.0 (October 23rd, 2015)

FEATURES:

  • Adds delete action for consul_template_config LWRP (GH-30)

IMPROVEMENTS:

  • Allows upstart to be used outside of Ubuntu (GH-29)
  • Updates default version of consul-template to 0.11.0, adds new checksums, and handles new zip format (GH-25) (GH-27) (GH-32)

BUG FIXES:

  • Notify restart runit_service if such is the init_style (GH-26)

v0.8.0 (May 18th, 2015)

FEATURES:

  • Adds support for systemd (GH-21)

IMPROVEMENTS:

  • Updates default version of consul-template to 0.7.0 and adds new checksums (GH-15)
  • Moves checksums to their own attribute file (GH-16)
  • Ensures config directory exists in LWRP (GH-18)
  • Fixes config directory permissions in LWRP (GH-19)

v0.7.0 (February 6th, 2015)

IMPROVEMENTS:

  • Adds recipe and support information to metadata.rb
  • Released to Chef Supermarket
  • Switching to true SemVer. To this point we were matching the version of the consul-template project, regardless of the changes to the cookbook itself.

v0.6.5 (February 5th, 2015)

BUG FIXES:

  • Assigns ownership of config files to the service user when using runit (GH-10)

IMPROVEMENTS:

  • Redirect stderr to stdout in the consul-template runner so that the runit logger gets the log data (GH-11)
  • Allow the consul_template.log_level attribute to control the log level used by consul when managed by runit (GH-11)
  • Dramatically improves ChefSpec test speed by switching to SoloRunner
  • Switch to JSON dump for default.json config file (GH-12)
  • Updates default version of consul-template to 0.6.5 and adds new checksums (GH-13)

v0.6.0 (January 23, 2015)

BREAKING CHANGES:

  • consul_template_config no longer notifies consul-template to reload from inside the LWRP (GH-8)

IMPROVEMENTS:

  • Updates default version to 0.6.0 and adds checksums (GH-9)
  • Adds usage message to generate-checksums script when no version is specified (GH-9)

Foodcritic Metric
            

0.10.0 passed this metric