Chef shell 脚本未运行
我在 Scalarium 上使用 Chef 下载代理并在其上运行各种命令。我正在尝试在配方中编写一个 shell 脚本来执行此操作。
file "/etc/profile.d/blah.sh" do
content <<-EOH
sudo -sH
<Retrieve file and run some commands>
EOH
end
当我在 Scalarium 中运行该配方时,没有发生错误,但命令也没有运行。命令本身没有错误,因为我在我的计算机上运行了它们。
该菜谱肯定已被读取,因为 Chef 日志包含 blah.localdomain 上的处理文件[/etc/profile.d/blah.sh]。
我以前从未使用过 Chef,我需要做其他事情来告诉它执行 shell 脚本吗?
I am using Chef on Scalarium to download an agent and run various commands on it. What I'm attempting is to write a shell script in the recipe to perform this.
file "/etc/profile.d/blah.sh" do
content <<-EOH
sudo -sH
<Retrieve file and run some commands>
EOH
end
When I run the recipe in Scalarium, no errors occur, but the commands aren't run either. There's no errors in the commands themselves, as I've run them on my computer.
The recipe is definitely read, as the Chef logs contain Processing file[/etc/profile.d/blah.sh] on blah.localdomain
.
I've never used Chef before, do I need to do something else to tell it to execute the shell script?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您想要类似的东西:
或者,您可以将文件检索和命令运行直接放入您的厨师食谱中:
Perhaps you want something like:
Or, you can put the file retrieval and running of commands directly into your chef recipe: