<%# kind: snippet name: remote_execution_ssh_keys %> <% if !@host.params['remote_execution_ssh_keys'].blank? %> <% ssh_user = @host.params['remote_execution_ssh_user'] || 'root' %> <% ssh_path = "~#{ssh_user}/.ssh" %> mkdir -p <%= ssh_path %> cat << EOF >> <%= ssh_path %>/authorized_keys <%= @host.params['remote_execution_ssh_keys'].join("\n") %> EOF chmod 700 <%= ssh_path %> chmod 600 <%= ssh_path %>/authorized_keys <% end %>