set #comment[1] "This file managed by Puppet. Local changes will be overwritten"
set #comment[2] "during the next Puppet run."
<% if @plugin and not @plugin.empty? -%>
<%   plugin_path = "#{@plugin}.#{@plugin_extension}" -%>
set plugin[.='<%= plugin_path -%>'] <%= plugin_path %>
<%   unless @args == '' or @args == nil or @args.empty? -%>
set plugin[.='<%= plugin_path -%>']/args <%= @args -%>
<%   end -%>
<% end -%>

set #comment[1] "This file managed by Puppet. Local changes will be overwritten"
set #comment[2] "during the next Puppet run."
<% if @plugin and not @plugin.empty? -%>
<%   plugin_path = "#{@plugin}.#{@extension}" -%>
set plugin[.='<%= plugin_path -%>'] <%= plugin_path %>
<%   unless @args == '' or @args == nil or @args.empty? -%>
set plugin[.='<%= plugin_path -%>']/args <%= @args -%>
<%   end -%>
<% end -%>

Rename the extension variable in template
Rename the extension variable in template

as we already did in the defined type..
