Created
June 4, 2013 18:52
-
-
Save murphy-slaw/5708456 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
action :create do | |
Chef::Log.info "Creating #{@new_resource.name}" | |
unless file_current?(@new_resource) | |
tmp = Tempfile.new(::File.basename(new_resource.name),::File.dirname(new_resource.name)) | |
tmp.close | |
ruby_block "move #{tmp.path}" do | |
FileUtils.mv(tmp.path, new_resource.name) | |
action :nothing | |
end | |
remote_file tmp.path do | |
source new_resource.source | |
action :create | |
notifies :run, "ruby_block['move #{tmp.path}']", :immediately | |
end | |
@new_resource.updated_by_last_action(true) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment