title: Convert Ansible variable from Unicode to ASCII
body: <p>I'm getting the output of a command on the remote system and storing it in a variable.  It is then used to fill in a file template which gets placed on the system.</p>
  
  <pre><code>- name: Retrieve Initiator Name
    command: /usr/sbin/iscsi-iname
    register: iscsiname
  
  - name: Setup InitiatorName File
    template: src=initiatorname.iscsi.template dest=/etc/iscsi/initiatorname.iscsi
  </code></pre>
  
  <p>The initiatorname.iscsi.template file contains:</p>
  
  <pre><code>InitiatorName={{ iscsiname.stdout_lines }}
  </code></pre>
  
  <p>When I run it however, I get a file with the following:</p>
  
  <pre><code>InitiatorName=[u'iqn.2005-03.org.open-iscsi:2bb08ec8f94']
  </code></pre>
  
  <p>What I want:</p>
  
  <pre><code>InitiatorName=iqn.2005-03.org.open-iscsi:2bb08ec8f94
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>I realize I could write this to the file with an "echo "InitiatorName=$(/usr/sbin/iscsi-iname)" > /etc/iscsi/initiatorname.iscsi" but that seems like an un-Ansible way of doing it.</p>
  
  <p>Thanks in advance.</p>