How to move/copy files locally with Chef

前端 未结 8 1485
感情败类
感情败类 2020-12-02 12:07

I haven\'t yet come across a Chef resource that will copy/move files locally. For example, I want to download jetty hightide and unzip it. Once done, copy all the files into

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 12:45

    Besides the way you've done it and accepted it, if you only wanted to run one command like you initially asked (copy or move), and not run a block of commands, then you could do it with the execute resource:

    execute "copy_core" do
        command "mv /var/tmp/jetty-hightide-7.4.5.v20110725 /opt/jetty"
        user "root"
    end
    

    Maybe this will help someone else looking at this in the future.

提交回复
热议问题