I currently use this code in a recipe:
template "/var/django/.ssh/id_rsa" do
source "id_rsa.erb"
owner "django"
group "django"
variables :key => ssh_key
mode 00600
end
And here's what id_rsa.erb
looks like:
<%= @key %>
I was wondering if I could avoid having a template, and simply produce the file from the string. Something like this perhaps:
file_from_string "/var/django/.ssh/id_rsa" do
source ssh_key
owner "django"
group "django"
mode 00600
end
Use the file
resource and specify the file contents to the content
property.
In your case, this would result in a resource definition similar to this:
file "/var/django/.ssh/id_rsa" do
content ssh_key
owner "django"
group "django"
mode 00600
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With