【发布时间】:2017-06-30 03:35:24
【问题描述】:
是否可以在 ruby_block 中使用 powershell_script? 我想在收敛阶段而不是编译阶段运行 powershell 脚本。 当前代码不起作用:
ruby_block 'ruby block so that code is run during convergence phase and not compilation phase' do
block do
buildNumber = "123"
powershell_script 'run powershell script' do
environment ({'buildNumber' => buildNumber})
code "path/to/script/script.ps1"
end
end
action :run
end
我知道您可以在 ruby_block 外部的 powershell_script 上使用保护以使其在收敛期间运行,但我需要在 ruby 块内定义的局部变量 buildNumber。
【问题讨论】:
标签: ruby chef-infra