The recipe is not fulfilled by the chef

I am making a simple recipe that apt-get updates the whole system.

include_recipe "apt" execute "apt-get upgrade -y" do command "apt-get upgrade -y" action :nothing end 

but it never starts:

 chef-solo -j node.json -W Recipe: up2date::default * execute[apt-get upgrade -y] action nothing[2012-11-12T13:05:04+01:00] INFO: Processing execute[apt-get upgrade -y] action nothing (up2date::default line 12) (up to date) 

Do not understand why?

Is there a better / cleaner way?

+4
source share
1 answer

If you include the "apt" recipe, you do not need to create the execute [apt-get upgrade -y] resource. Or if you do not want to include the recipe "apt", use

 execute "apt-get upgrade -y" do command "apt-get upgrade -y" action :run end 

But since run is the default action, and the name is the default command, which can be shortened to

 execute "apt-get upgrade -y" 
+3
source

Source: https://habr.com/ru/post/1445494/


All Articles