Giter Club home page Giter Club logo

consul_template's Introduction

Build Status Code Quality Code Climate Cookbook Version GitHub license

Consul Template Cookbook

Installs & configures the Consul Template service.

Requirements

OS

supports 'ubuntu', '>= 12.04'
supports 'redhat', '>= 6.4'
supports 'centos', '>= 6.4'
supports 'windows'
supports 'freebsd'

Cookbooks

depends 'poise', '~> 2.6'
depends 'poise-service', '~> 1.1'
depends 'rubyzip', '~> 1.0'
depends 'nssm', '~> 1.2'

Usage

This cookbook was designed to expose most of configuration through node attributes. To use it, overide the attributes you need & include the default recipe in your runlist. You can alternatively customize everything by declaring the necessary resources yourself.

Attributes

Key Type Description Default
['consul_template']['service_name'] String The name of the service consul-template
['consul_template']['version'] String The version of Consul Template to install 0.14.0
['consul_template']['config']['conf_dir'] String The configuration directory for Consul Template /etc/consul-template/conf.d OR C:\Program Files\consul-template\conf.d
['consul_template']['config']['template_dir'] Hash A hash of Consul Template options to pass to the consul_template_config resource (options) {}
['consul_template']['service']['data_dir'] Hash The data directory for Consul Template /var/lib/consul-template OR C:\Program Files\consul-template\data
['consul_template']['service']['environment'] Hash A list of environment variables that will be set for the service (Linux only) {}
['consul_template']['service']['user'] String The user to run the service as consul-template
['consul_template']['service']['group'] String The group of the service user consul-template
['consul_template']['service']['nssm_params'] Hash A hash of NSSM options to set for the service (Windows only) options See attributes file

Resources

consul_template_config

consul_template_config 'consul-template' do
  conf_dir
  template_dir
  owner
  group
  # https://github.com/hashicorp/consul-template#options
  options
  # Optional, but recommeneded
  notifies :restart, "consul_template_service[#{service_name}]", :delayed
end

consul_template_installation

consul_template_installation 'consul-template' do
  version
end

The following cannot be specified as a property on this resource, but they do have a direct effect on it. They're managed through node attributes.

archive_url # node['consul_template']['archive_url']
install_path # node['consul_template']['install_path']

consul_template_service

consul_template_service 'consul-template' do
  user
  group
  conf_dir
  data_dir
  environment
  nssm_params # Windows only
  program
end

consul_template

This resource is used for placing x2 files:

  1. A configuration file containing a template block in your configuration directory.
  2. An input template file (.ctmpl) in your template directory.
consul_template 'example.json' do
  source
  cookbook
  content
  options
  conf_dir
  template_dir
  owner
  group
  destination
  command
  command_timeout
  perms
  backup
  # Optional, but recommeneded
  notifies :restart, 'consul_template_service[consul-template]', :delayed
end

This resource uses the Template Content helper from the Poise cookbook. This exposes the following 4 properties:

  • source - The name of the file or template (e.g. template.ctmpl.erb).
  • cookbook - The name of the cookbook in which the file or template resides.
  • options - A hash of variables to be evaluated in the template.
  • content - The raw content of the file or template (used independently).

Contributing

Please refer to CONTRIBUTING.md.

Extra

Other Hashicorp Cookbooks:

Thanks

Special thanks to:

consul_template's People

Contributors

ginja avatar

Watchers

James Cloos avatar Brad Tillman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.