-
-
Save clifferson/3376042 to your computer and use it in GitHub Desktop.
Modify a file line inline in 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
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 | |
http://tickets.opscode.com/browse/CHEF-78?focusedCommentId=10781&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-10781 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment