What is the idiomatic way to install a Debian package using Chef?

前端 未结 1 1340
我在风中等你
我在风中等你 2021-02-02 10:16

Below my code for installing vcider. I am learning chef but have not seen anything for installing a dpkg. I would like to use version in the script. The code below works.

相关标签:
1条回答
  • 2021-02-02 11:01

    The Right Thing is to use the built-in resource types. Presuming you've set the version and arch variables appropriately:

    remote_file "/tmp/vcider_#{version}_#{arch}.deb" do
      source "https://my.vcider.com/m/downloads/vcider_#{version}_#{arch}.deb"
      mode 0644
      checksum "" # PUT THE SHA256 CHECKSUM HERE
    end
    
    dpkg_package "vcider" do
      source "/tmp/vcider_#{version}_#{arch}.deb"
      action :install
    end
    
    0 讨论(0)
提交回复
热议问题