[% USE CSV -%]
[% CSV.dump([ 'Device' 'Port' 'Port Description' 'Admin Status' ]) %]

[% FOREACH row IN results %]
  [% mylist = [] %]
  [% mylist.push(row.dns || row.name || row.ip) %]
  [% mylist.push(row.port) %]
  [% mylist.push(row.description) %]
  [% mylist.push(row.up_admin) %]
  [% CSV.dump(mylist) %]

[% END %]
