How can I get Chef to run apt-get update before running other recipes

后端 未结 12 1535
一生所求
一生所求 2021-01-31 02:01

Right now I have the following in my Vagrantfile:

config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = \"cookbooks\"
    chef.add_recipe \"apt\"
           


        
12条回答
  •  佛祖请我去吃肉
    2021-01-31 02:47

    To run apt-get update at compile time, do:

    e = execute "apt-get update" do
      action :nothing
    end
    
    e.run_action(:run)
    

    check https://wiki.opscode.com/display/chef/Evaluate+and+Run+Resources+at+Compile+Time

提交回复
热议问题