Skip to content

Instantly share code, notes, and snippets.

@Freeaqingme
Created January 8, 2014 21:16
Show Gist options
  • Save Freeaqingme/8324817 to your computer and use it in GitHub Desktop.
Save Freeaqingme/8324817 to your computer and use it in GitHub Desktop.
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: /etc/puppet/modules/modulename/templates/authorized_keys.erb:10: syntax error, unexpected $end, expecting keyword_end
; _erbout.force_encoding(__ENCODING__)
^
cat /etc/puppet/modules/modulename/templates/authorized_keys.erb
# File managed by Puppet
#
<% @ssh_keys.each do |key| -%>
<% if scope.lookupvar('transipuser::bool_enable_two_factor_auth') == true -%>
command="/usr/local/bin/two-factor-auth-check",no-port-forwarding,no-X11-forwarding,no-agent-forwarding <%= key %>
<% else %>
<%= key %>
<% end -%>
erb -x -T - /etc/puppet/modules/modulename/templates/authorized_keys.erb
#coding:ASCII-8BIT
_erbout = ''; _erbout.concat "# File managed by Puppet\n#\n"
; @ssh_keys.each do |key|
if scope.lookupvar('transipuser::bool_enable_two_factor_auth') == true
_erbout.concat "command=\"/usr/local/bin/two-factor-auth-check\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding "; _erbout.concat(( key ).to_s); _erbout.concat "\n"
; else ; _erbout.concat "\n"
; _erbout.concat(( key ).to_s); _erbout.concat "\n"
; end
_erbout.concat "\n"
; _erbout.force_encoding(__ENCODING__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment