lib/poolparty/plugins/line_in_file.rb in auser-poolparty-1.2.2 vs lib/poolparty/plugins/line_in_file.rb in auser-poolparty-1.2.3
- old
+ new
@@ -15,10 +15,14 @@
has_line_in_file("ENABLED=1", "/etc/default/haproxy")
=end
class LineInFile
- virtual_resource(:line_in_file) do
+ plugin :line_in_file do
+ dsl_methods :file, :line
+ default_options(
+ :line => ""
+ )
def loaded(opts={}, &block)
has_exec "line_in_#{file}" do
command "grep -q \'#{line.safe_quote}\' #{file} || echo \'#{line.safe_quote}\' >> #{file}"
not_if "grep -q \'#{line.safe_quote}\' #{file}"
end
\ No newline at end of file