【发布时间】:2015-01-15 03:01:06
【问题描述】:
我已经通过厨师食谱创建了一个文件。代码如下。
execute "helloworld.txt" do
command "mkdir /etc/#{node['jboss']['user']}"
not_if { ::File.exists?("/etc/#{node['jboss']['user']}")}
end
file "/etc/jboss-as/helloworld.txt" do
owner 'user'
group 'user'
mode 0755
action :create_if_missing
end
template "/etc/jboss-as/helloworld.txt" do
source "helloworld.txt.erb"
end
我的helloworld.txt文件内容如下:
TESTING
Hello World
Hello Winnie
Hello Everyone
Hello Boy
我想使用代码编辑上面的命令,将 Hello Boy 编辑为 Hello Girl,我应该使用什么命令,我需要做什么?我不想直接从 helloworld.txt 更改内容。
请在下面发表评论以显示您的解决方案。谢谢。
【问题讨论】: