Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@thommay
Created January 9, 2012 10:29
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thommay/1582357 to your computer and use it in GitHub Desktop.
Save thommay/1582357 to your computer and use it in GitHub Desktop.
ruby_block "configure #{p} module" do
block do
require 'chef/util/file_edit'
nc = Chef::Util::FileEdit.new("/etc/reconnoiter/noit.conf")
nc.insert_line_after_match(/lua.*noit.module.smtp/, "<module loader=\"lua\" name=\"#{p}\" object=\"noit.module.#{p}\"/>")
nc.write_file
Chef::Log.info "Inserted module config for #{p}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment