How to move/copy files locally with Chef

前端 未结 8 1513
感情败类
感情败类 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:52

    I got it working by using bash resource as below:

    bash "install_jettyhightide" do
      code <<-EOL
      unzip /var/tmp/jetty-hightide-7.4.5.v20110725.zip -d /opt/jetty/
      mv /opt/jetty/jetty-hightide-7.4.5.v20110725/* /opt/jetty/
      cp /opt/jetty/bin/jetty.sh /etc/init.d/jetty
      update-rc.d jetty defaults
      EOL
    end
    

    But I was really hoping for a chef way of doing it. copying/moving files locally would be the most generic task a sysadmin will need to do.

提交回复
热议问题