Created
June 22, 2011 15:14
-
-
Save jbz/1040306 to your computer and use it in GitHub Desktop.
Client/server config with chef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set attribute indicating munin role | |
node.set["munin"]["node"] = true | |
# Find available munin servers | |
available_servers = search(:node, "munin_server:true") | |
# Install munin plugins | |
munin_plugin "passenger_memory_stats" | |
munin_plugin "passenger_status" | |
cookbook_file "/etc/munin/plugin-conf.d/munin-node" do | |
source "plugin-conf.d_munin-node" | |
mode "0644" | |
notifies :restart, "service[munin-node]" | |
end | |
template "/etc/munin/munin-node.conf" do | |
source "munin-node.conf.erb" | |
mode "0644" | |
variables(:munin_servers => available_servers) | |
notifies :restart, "service[munin-node]", :immediately | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
munin_clients = search(:node, "munin_node:true") | |
template "/etc/munin/munin.conf" do | |
source "munin.conf.erb" | |
mode 0644 | |
variables(:munin_nodes => munin_clients) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment