include_recipe "munin"
ohai_plugin "hardware" do
- template_source "ohai.rb.erb"
+ template "ohai.rb.erb"
end
case node[:cpu][:"0"][:vendor_id]
end
nginx_site "default" do
- template_source "nginx_default.conf.erb"
+ template "nginx_default.conf.erb"
directory "/srv/imagery/default"
restart_nginx false
end
recursive true
end
- template "/srv/#{new_resource.site}/index.html" do
+ declare_resource :template, "/srv/#{new_resource.site}/index.html" do
source "index.html.erb"
user "root"
group "root"
YAML.safe_load(::File.read(path), [Symbol])
end
- template "/srv/#{new_resource.site}/imagery.js" do
+ declare_resource :template, "/srv/#{new_resource.site}/imagery.js" do
source "imagery.js.erb"
user "root"
group "root"
end
nginx_site new_resource.site do
- template_source "nginx_imagery.conf.erb"
+ template "nginx_imagery.conf.erb"
directory "/srv/imagery/#{new_resource.site}"
restart_nginx false
variables new_resource.to_hash.merge(:resolvers => resolvers)
end
munin_plugin_conf "memcached_multi" do
- template_source "munin.erb"
+ template "munin.erb"
end
%w[bytes commands conns evictions items memory].each do |stat|
end
munin_plugin_conf "df" do
- template_source "df.erb"
+ template "df.erb"
end
munin_plugin "df"
node[:hardware][:network] &&
node[:hardware][:network][ifname][:device] =~ /^virtio/
munin_plugin_conf "if_#{ifname}" do
- template_source "if.erb"
+ template "if.erb"
variables :ifname => ifname
end
else
end
else
munin_plugin_conf "ipmi" do
- template_source "ipmi.erb"
+ template "ipmi.erb"
end
munin_plugin "ipmi_fans" do
if new_resource.conf # ~FC023
munin_plugin_conf new_resource.plugin do
cookbook new_resource.conf_cookbook
- template_source new_resource.conf
+ template new_resource.conf
variables new_resource.conf_variables
restart_munin false
end
property :plugin_conf, :kind_of => String, :name_attribute => true
property :cookbook, :kind_of => [String, nil]
-property :template_source, :kind_of => String, :required => true
+property :template, :kind_of => String, :required => true
property :variables, :kind_of => Hash, :default => {}
property :restart_munin, :kind_of => [TrueClass, FalseClass], :default => true
action :create do
- template config_file do
+ declare_resource :template, config_file do
cookbook new_resource.cookbook
- source new_resource.template_source
+ source new_resource.template
owner "root"
group "root"
mode 0o644
property :site, :kind_of => String, :name_attribute => true
property :directory, :kind_of => String
property :cookbook, :kind_of => String
-property :template_source, :kind_of => String, :required => true
+property :template, :kind_of => String, :required => true
property :variables, :kind_of => Hash, :default => {}
property :restart_nginx, :kind_of => [TrueClass, FalseClass], :default => true
action :create do
- template conf_path do
+ declare_resource :template, conf_path do
cookbook new_resource.cookbook
- source new_resource.template_source
+ source new_resource.template
owner "root"
group "root"
mode 0o644
end
munin_plugin_conf "nominatim" do
- template_source "munin.erb"
+ template "munin.erb"
variables :db => node[:nominatim][:dbname],
:querylog => "#{node[:nominatim][:logdir]}/query.log"
end
default_action :create
property :plugin, :kind_of => String, :name_attribute => true
-property :template_source, :kind_of => String, :required => true
+property :template, :kind_of => String, :required => true
action :create do
ohai new_resource.plugin do
action :nothing
end
- template plugin_path do
- source new_resource.template_source
+ declare_resource :template, plugin_path do
+ source new_resource.template
owner "root"
group "root"
mode 0o644
end
action :delete do
- template plugin_path do
+ file plugin_path do
action :delete
end
end
end
ohai_plugin "postgresql" do
- template_source "ohai.rb.erb"
+ template "ohai.rb.erb"
end
package "ptop"
default_action :create
property :fragment, :kind_of => String, :name_attribute => true
-property :template_source, :kind_of => String, :required => true
+property :template, :kind_of => String, :required => true
property :variables, :kind_of => Hash, :default => {}
action :create do
- template fragment_path do
- source new_resource.template_source
+ declare_resource :template, fragment_path do
+ source new_resource.template
owner "root"
group "root"
mode 0o644
end
squid_fragment "tilecache" do
- template_source "squid.conf.erb"
+ template "squid.conf.erb"
variables :caches => tilecaches, :renders => tilerenders
end
end
nginx_site "tile-ssl" do
- template_source "nginx_tile_ssl.conf.erb"
+ template "nginx_tile_ssl.conf.erb"
variables :resolvers => resolvers, :caches => tilecaches
end