title: how to use ansible b64encode
body: <p>I need to do base64 encoding of something like: "<a href="https://myurl.com" rel="noreferrer">https://myurl.com</a>". Because there is a colon in that string, I need to enclose everything in quotes. So I have something like:</p>
  
  <pre><code>- name: do the encode
    shell: 'echo "https://myurl.com" | /usr/bin/base64'
    register: bvalue
  </code></pre>
  
  <p>But I get a blank when I use:</p>
  
  <pre><code>{{ bvalue.stdout }}
  </code></pre>
  
  <p>So I want to use the Ansible construct, but I don't know how and the documentation is not clear. It's something like:</p>
  
  <pre><code>- name: do the encode
    shell: '{{ "https://myurl.com" | b64encode }}'
  </code></pre>
  
  <p>But I <em>know</em> that is wrong. And I can't find any examples. Help!</p>