pidファイルをチェックするタイプのmonit.confを一気に作りたいとき。 recipes/defualt.rb service "monit" do action :nothing end common_process = ["ntpd", "sshd", "crond"] common_process.each do |proc| template "/etc/monit.d/#{proc}.conf" do source "monit_template.conf.erb" owner "root" group "root" mode 0644 notifies :restart, "service[monit]" variables ({ :process_name => proc, :pidfile => "/var/run/#{proc}.pid", :program =>
![monitのrecipe | iret.media](https://cdn-ak-scissors.b.st-hatena.com/image/square/377a9c51a86d20c871561f0ba1caf65409e4f7f2/height=288;version=1;width=512/https%3A%2F%2Firet.media%2Fwp-content%2Fthemes%2Fclp_media%2Fimg%2Fcommon%2Fogp-thumbnail_1200x630.png%3F135792468)