在 Chef 中,有没有更好的方法在安装后删除安装程序
Is there a better way to delete an installer after installation, in chef
例如
remote_file '/app/abc/' + '/app.rpm' do
source "https://location.com/app.rpm"
end
package 'app.rpm' do
source '/app/abc/app.rpm'
end
file '/app/abc/app.rpm' do
action :delete
end
这就是我目前删除 rpm 文件的方式。有没有更好的方法来编写代码,而不必再次包含 file
资源?
我们通常建议不要删除,以便您可以使用该文件进行幂等性检查,如果远程文件发生更改,则使用通知 运行 软件包安装。
例如
remote_file '/app/abc/' + '/app.rpm' do
source "https://location.com/app.rpm"
end
package 'app.rpm' do
source '/app/abc/app.rpm'
end
file '/app/abc/app.rpm' do
action :delete
end
这就是我目前删除 rpm 文件的方式。有没有更好的方法来编写代码,而不必再次包含 file
资源?
我们通常建议不要删除,以便您可以使用该文件进行幂等性检查,如果远程文件发生更改,则使用通知 运行 软件包安装。