我目前在食谱中使用此代码:
template "/var/django/.ssh/id_rsa" do
source "id_rsa.erb"
owner "django"
group "django"
variables :key => ssh_key
mode 00600
end
看起来id_rsa.erb
是这样的:
<%= @key %>
我想知道是否可以避免使用模板,而只需从字符串中生成文件。可能是这样的:
file_from_string "/var/django/.ssh/id_rsa" do
source ssh_key
owner "django"
group "django"
mode 00600
end