elijah / chef-prometheus

Chef cookbook for Prometheus. The open source service monitoring system and time-series database.
Apache License 2.0
52 stars 93 forks source link

sysv init template path on chef 11 #19

Closed ewr closed 9 years ago

ewr commented 9 years ago

Running the cookbook with the sysv init style on Chef 11.16.4, I got a template resolution error:

    Chef::Exceptions::FileNotFound
    ------------------------------
    Cookbook 'prometheus' (0.3.0) does not contain a file at any of these locations:
      templates/ubuntu-12.04/ubuntu/prometheus.erb
      templates/ubuntu/ubuntu/prometheus.erb
      templates/default/ubuntu/prometheus.erb

    This cookbook _does_ contain: ['prometheus.conf.erb','prometheus.pill.erb','sv-prometheus-run.erb','prometheus.erb'] 

You can see that it's doubling up the platform.

Changing the template source from "#{node['platform']}/prometheus.erb" to just prometheus.erb fixed it for me.

The current path seems to work on Chef 12, but I believe the changed version should as well. Chef automatically adds the platform path when resolving templates.

rayrod2030 commented 9 years ago

I'll take a look. Thanks for the bug report!

rayrod2030 commented 9 years ago

https://github.com/rayrod2030/chef-prometheus/pull/21

rayrod2030 commented 9 years ago

Released fix: https://github.com/rayrod2030/chef-prometheus/releases/tag/0.4.0