title: Installing docker-ce through puppet
body: <p>Im trying to install docker-ce through puppet and i have a couple of questions.</p>
  <p>1: Does apt::key automatically do a 'apt-get update' afterwards?</p>
  <p>2: How can i use the apt:ppa module to add the docker-ce <a href="https://docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository" rel="nofollow noreferrer">repository</a>?
  this is done with:</p>
  <pre><code>sudo add-apt-repository \
     &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu \
     $(lsb_release -cs) \
     stable&quot;
  </code></pre>
  <p>But how would i use the apt::ppa to include distribution and release?</p>
  <p>This is the whole puppet block:</p>
  <pre><code>class docker {
  
    $prerequisites = ['apt-transport-https', 'ca-certificates', 'curl']
    package { $prerequisites: ensure =&gt; installed}
  
    apt::key { 'docker-ce':
      ensure    =&gt; present,
      id        =&gt; '9DC858229FC7DD38854AE2D88D81803C0EBFCD88',
      options   =&gt; 'https://download.docker.com/linux/ubuntu/gpg',
    }
  
    apt::ppa {''}
  
    package {'docker-ce': ensure  =&gt; installed}
  }
  </code></pre>
  <p><strong>EDIT:</strong></p>
  <p>Ended up using the apt module with apt::source, hardcoded release because i know all my systems will run it.</p>
  <pre><code>class docker {
    include apt
  
    $prerequisites = ['apt-transport-https', 'ca-certificates']
    package { $prerequisites: ensure =&gt; installed} -&gt;
  
    apt::key { 'docker-ce':
       ensure    =&gt; present,
       id        =&gt; '9DC858229FC7DD38854AE2D88D81803C0EBFCD88',
       options   =&gt; 'https://download.docker.com/linux/ubuntu/gpg',
    } -&gt;
  
    apt::source {'docker-ce':
       location  =&gt; 'https://download.docker.com/linux/ubuntu',
       release   =&gt; 'xenial'
    } -&gt;
  
    exec { 'apt-get-update':
       command   =&gt; '/usr/bin/apt-get update'
    } -&gt;
  
    package {'docker-ce': ensure  =&gt; installed}
  }
  </code></pre>