X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/6bf5013e5d298962c5a54bc395b53a5ec1a8a5ba..84f17c000a6997b9736011730c5764b09921c6f7:/cookbooks/postgresql/providers/munin.rb?ds=sidebyside diff --git a/cookbooks/postgresql/providers/munin.rb b/cookbooks/postgresql/providers/munin.rb deleted file mode 100644 index efa0a8b4d..000000000 --- a/cookbooks/postgresql/providers/munin.rb +++ /dev/null @@ -1,58 +0,0 @@ -# -# Cookbook Name:: postgresql -# Provider:: postgresql_munin -# -# Copyright 2015, OpenStreetMap Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -def whyrun_supported? - true -end - -use_inline_resources - -action :create do - cluster = node[:postgresql][:clusters] && node[:postgresql][:clusters][new_resource.cluster] - database = new_resource.database - - if cluster - %w[cache connections locks querylength scans size transactions tuples].each do |plugin| - munin_plugin "postgres_#{plugin}_#{database}:#{suffix}" do - target "postgres_#{plugin}_" - conf "munin.erb" - conf_cookbook "postgresql" - conf_variables :port => cluster[:port] - restart_munin false - end - end - else - Chef::Log.info "Postgres cluster #{new_resource.cluster} not found" - end -end - -action :delete do - database = new_resource.database - - %w[cache connections locks querylength scans size transactions tuples].each do |plugin| - munin_plugin "postgres_#{plugin}_#{database}:#{suffix}" do - action :delete - restart_munin false - end - end -end - -def suffix - new_resource.cluster.tr("/", ":") -end