title: Apt-get update error on ubuntu 16.04 by using Ansible playbook
body: <p>I have written ansible playbook for installing the docker on Ubuntu 16.04 LTS.
  While running the ansible playbook, I am getting apt-get update error</p>
  <p>I have tried running the attached playbook code.</p>
  <pre class="lang-yaml prettyprint-override"><code>      - hosts: docker
          become: yes
          become_user: root
          tasks:
             - name: apt-get update
               shell: apt-get update -y
             - name: Install packages to allow apt to use a repository   overHTTPS
               shell: sudo apt-get install -y \
                      apt-transport-https -y \
                      ca-certificates \
                      curl \
                      gnupg-agent \
                      software-properties-common
             - name: Add Docker’s official GPG key
               shell: curl -fsSL    https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
             - name: Use the following command to set up the stable repository
               shell: add-apt-repository \
                      &quot;deb [arch=amd64]   https://download.docker.com/linux/ubuntu\
                      $(lsb_release -cs) \
                      stable&quot;
             - name: apt update
               shell: apt-get update -y
             - name: Installing the docker 17.03.0
               shell: apt-get install docker-ce=18.06.1~ce-3-0~ubuntu -y
  </code></pre>
  <p>Before installing the docker, I try to update the ubuntu server, but I am getting below error</p>
  <pre><code>          TASK [apt update]      **************************************************************
           fatal: [localhost]: FAILED! =&gt; {&quot;changed&quot;: true, &quot;cmd&quot;: &quot;apt-         get update -y&quot;, &quot;delta&quot;: &quot;0:00:12.338257&quot;,
           &quot;end&quot;: &quot;2019-04-02 11:58:13.377956&quot;, &quot;failed&quot;: true, &quot;rc&quot;:   100, &quot;start&quot;: &quot;2019-04-02 11:58:01.039699&quot;,
            &quot;stderr&quot;: &quot;W: The repository   'https://download.docker.com/linux/ubuntu\\ xenial Release' does not    have
            a Release file.\nE: Failed to fetch    https://download.docker.com/linux/ubuntu\\/dists/xenial/\\/binary-
           amd64/Packages  404  Not Found\nE: Some index files failed to   download. They have been ignored, or old 
           ones used instead.&quot;, &quot;stdout&quot;: &quot;Hit:1 http://us-  east1.gce.archive.ubuntu.com/ubuntu xenial InRelease\nH
           it:2 http://us-east1.gce.archive.ubuntu.com/ubuntu xenial- updates InRelease\nHit:3 http://us-east1.gce.
           archive.ubuntu.com/ubuntu xenial-backports InRelease\nHit:4   http://archive.canonical.com/ubuntu xenial 
           InRelease\nHit:5 http://ppa.launchpad.net/ansible/ansible/ubuntu xenial InRelease\nHit:6   http://securit
           y.ubuntu.com/ubuntu xenial-security InRelease\nIgn:7   https://download.docker.com/linux/ubuntu\\ xenial 
           InRelease\nIgn:8 https://download.docker.com/linux/ubuntu\\   xenial Release\nIgn:9 https://download.dock
          er.com/linux/ubuntu\\ xenial/\\ amd64 Packages\nIgn:10 https://download.docker.com/linux/ubuntu\\ xenia
          l/\\ all Packages\nIgn:11   https://download.docker.com/linux/ubuntu\\ xenial/\\ Translation-  en_US\nIgn:1
          2 https://download.docker.com/linux/ubuntu\\ xenial/\\   Translation-en\nIgn:13 https://download.docker.c
          om/linux/ubuntu\\ xenial/stable amd64 Packages\nIgn:14 https://download.docker.com/linux/ubuntu\\ xenia
          l/stable all Packages\nIgn:15   https://download.docker.com/linux/ubuntu\\ xenial/stable Translation-  en_U
           S\nIgn:16 https://download.docker.com/linux/ubuntu\\   xenial/stable Translation-en\nIgn:9 https://downlo
           ad.docker.com/linux/ubuntu\\ xenial/\\ amd64 Packages\nIgn:10    https://download.docker.com/linux/ubuntu\
           \ xenial/\\ all Packages\nIgn:11   https://download.docker.com/linux/ubuntu\\ xenial/\\ Translation-en_US
            \nIgn:12 https://download.docker.com/linux/ubuntu\\ xenial/\\     Translation-en\nIgn:13 https://download.d
           ocker.com/linux/ubuntu\\ xenial/stable amd64 Packages\nIgn:14   https://download.docker.com/linux/ubuntu\
           \ xenial/stable all Packages\nIgn:15     https://download.docker.com/linux/ubuntu\\ xenial/stable Translati
          on-en_US\nIgn:16 https://download.docker.com/linux/ubuntu\\    xenial/stable Translation-en\nIgn:9 https:/
          /download.docker.com/linux/ubuntu\\ xenial/\\ amd64      Packages\nIgn:10 https://download.docker.com/linux/
          ubuntu\\ xenial/\\ all Packages\nIgn:11    https://download.docker.com/linux/ubuntu\\ xenial/\\ Translatio
           n-en_US\nIgn:12 https://download.docker.com/linux/ubuntu\\  xenial/\\ Translation-en\nIgn:13 https://dow
           nload.docker.com/linux/ubuntu\\ xenial/stable amd64    Packages\nIgn:14 https://download.docker.com/linux/
         ubuntu\\ xenial/stable all Packages\nIgn:15 https://download.docker.com/linux/ubuntu\\ xenial/stable Tr
          anslation-en_US\nIgn:16 https://download.docker.com/linux/ubuntu\\ xenial/stable Translation-en\nIgn:9 
         https://download.docker.com/linux/ubuntu\\ xenial/\\ amd64 Packages\nIgn:10 https://download.docker.com
        /linux/ubuntu\\ xenial/\\ all Packages\nIgn:11  https://download.docker.com/linux/ubuntu\\ xenial/\\ Tra
        nslation-en_US\nIgn:12 https://download.docker.com/linux/ubuntu\\ xenial/\\ Translation-en\nIgn:13 http
          s://download.docker.com/linux/ubuntu\\ xenial/stable amd64  Packages\nIgn:14 https://download.docker.com
       /linux/ubuntu\\ xenial/stable all Packages\nIgn:15
  </code></pre>