我正在编写一个厨师食谱来安装Oracle EE软件(通过以静默模式运行setup.exe),使用主厨资源'execute',如下所示。
str_command = "<dir>/setup.exe -silent -nowait -noconfig -waitforcompletion ORACLE_HOME=... ORACLE_BASE=... " # other parameters for silent installation
Chef::Log.info("-before-")
execute 'install_oracle_ee' do
command str_command
live_stream true
timeout "#{node['mycookbk']['timeout']['num']}"
not_if {File.exists?("#{node['mycookbk']['oracle']['oracle_home']}/bin")}
end
Chef::Log.info("-after-")
软件安装成功后,我需要执行资源/配方,“创建数据库实例”,然后“创建数据库”。
目前,执行资源在运行命令后存在,并直接移动到运行列表中的下一个资源/配方。
但是我需要确保在完成设置之前完成设置。任何人都可以建议一种方法来做到这一点?
这意味着命令实际上并没有等待完成。 Chef确实等待提供的可执行文件完成(实际上它必须,没有选项不这样做)。仔细检查安装程序的CLI选项?