Skip to content

Instantly share code, notes, and snippets.

@coderanger
Created January 18, 2011 02:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderanger/783899 to your computer and use it in GitHub Desktop.
Save coderanger/783899 to your computer and use it in GitHub Desktop.
action :append do
execute "cat #{new_resource.line} >>#{new_resource.path}" do
not_if "grep '#{new_resource.line}' #{new_resource.file}"
end
end
actions :append
attribute :path, :kind_of => String, :name_attribute => true
attribute :line, :kind_of => String, :required => true
cookbookname_append "/path/to/file" do
line "foo"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment