title: FAILED! => {"changed": false, "msg": "apt cache update failed"} when trying to
body: <p>I am new to <a href="https://en.wikipedia.org/wiki/Ansible_(software)" rel="nofollow noreferrer">Ansible</a> and try, as an example, a task to install <a href="https://en.wikipedia.org/wiki/Vivaldi_%28web_browser%29" rel="nofollow noreferrer">Vivaldi</a>. My only task in a role <code>Vivaldi update</code> starts with</p>
  <pre class="lang-yaml prettyprint-override"><code>    - name: Run apt upgrade
        apt:
          upgrade: &quot;yes&quot;
          update_cache: yes
          cache_valid_time: 432000
  
      - name: Add Vivaldi Repository
        apt_repository:
            repo: &quot;deb https://repo.vivaldi.com/stable/deb/ stable main&quot;
            state: present
            filename: vivaldi.list
            update_cache: true
        tags:
           - vivaldi
  </code></pre>
  <p>And with this, I fail on <a href="https://en.wikipedia.org/wiki/Localhost" rel="nofollow noreferrer">localhost</a> on a <a href="https://en.wikipedia.org/wiki/Debian_version_history#Debian_10_(Buster)" rel="nofollow noreferrer">Debian 10</a> (Buster) installation:</p>
  <p><em>Linux london 4.19.0-12-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/Linux).</em></p>
  <p>All commands succeed on the command line.</p>
  <p>Ansible is 2.9.15.</p>
  <p>The first task runs OK (if run alone), but the second fails with:</p>
  <blockquote>
  <p>FAILED! =&gt; {&quot;changed&quot;: false, &quot;msg&quot;: &quot;apt cache update failed&quot;}.</p>
  </blockquote>
  <p>A task to add a repository key fails with:</p>
  <blockquote>
  <p>FAILED! =&gt; {&quot;changed&quot;: false, &quot;id&quot;: &quot;6D3789EDC3401E12&quot;, &quot;msg&quot;: &quot;key does not seem to have been added&quot;}</p>
  </blockquote>
  <p>However, if I add the repository manually to <code>/etc/apt/sources.list</code> the last task,</p>
  <pre class="lang-yaml prettyprint-override"><code>    - name: Install Vivaldi
        apt:
            name: vivaldi-stable
            update_cache: yes
            state: latest
        tags:
           - vivaldi
  </code></pre>
  <p>it succeeds.</p>
  <p>What am I doing wrong?</p>