cookbook 'consul_template', '~> 0.1.0'
consul_template (1) Versions 0.1.0 Follow1
Installs/Configures consul_template
cookbook 'consul_template', '~> 0.1.0', :supermarket
knife supermarket install consul_template
knife supermarket download consul_template
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](attributes/default.rb) |
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:
- A configuration file containing a template block in your configuration directory.
- 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](./CONTRIBUTING.md).
Extra
Other Hashicorp Cookbooks:
Thanks
Special thanks to:
* John Bellone for all his work on the Consul & Vault Cookbooks.
* Noah Kantrowitz for creating the Poise suite of Cookbooks.
Dependent cookbooks
poise ~> 2.6 |
poise-service ~> 1.1 |
rubyzip ~> 1.0 |
nssm ~> 1.2 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Change Log
v0.1.0 (2016-04-06)
* This Change Log was automatically generated by github_changelog_generator
Collaborator Number Metric
0.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.0 passed this metric
Foodcritic Metric
0.1.0 passed this metric
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 passed this metric
Foodcritic Metric
0.1.0 passed this metric
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 passed this metric
0.1.0 passed this metric
Testing File Metric
0.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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 passed this metric