title: Puppet does not update package after changing the repo
body: <p>According to <a href="https://docs.gitlab.com/runner/install/linux-repository.html#upgrading-to-gitlab-runner-10" rel="nofollow noreferrer">https://docs.gitlab.com/runner/install/linux-repository.html#upgrading-to-gitlab-runner-10</a> the repos changed, so we are trying to update the gitlab-runner of all nodes. <strong>We need to delete the old repo and add the new one and then update the package.</strong></p>
  
  <p>On our puppet manifest[1] we update the repo, ensure the latest version of the package and after this update we have to run a script before ensuring that a service is running.
  Our problem is that we should only run this script after an update.</p>
  
  <p>Right now, even if the repo is updated, the package is not. The package is only updated if distro_sync runs or if we run "<em>yum update gitlab-runner</em>", never through a puppet run. It seems that the package is never updated as if it was checking the latest version of the old repo instead of comparing against the recently added repo.</p>
  
  <p>[1]</p>
  
  <pre><code># Installs a GitLab-CI runner for CERN GitLab
  class gitlab::gitlab_ci_runner (
    String $ensure = 'latest', # passed to the gitlab-runner package. Can be used to force a version
  ) {
    ensure_resource('yumrepo', 'gitlab-runner', {
        descr    =&gt; 'gitlab-runner for EL6/7',
        baseurl  =&gt; "http://packages.gitlab.com/runner/gitlab-runner/el/${::operatingsystemmajorrelease}/${::architecture}",
        gpgcheck =&gt; 0,
        enabled  =&gt; 1,
        exclude  =&gt; absent,
    })
  
    ensure_packages(['gitlab-runner'], {
      ensure  =&gt; $ensure,
      require =&gt; Yumrepo['gitlab-runner'],
    })
  
    exec {"post-install":
      command =&gt; 'sudo /usr/share/gitlab-runner/post-install',
      provider =&gt; shell,
      onlyif  =&gt; 'test -e /usr/share/gitlab-runner/post-install',
      refreshonly =&gt; true,
      subscribe =&gt; Package['gitlab-runner'],
    }
  
    service { 'gitlab-runner':
      ensure  =&gt; running,
      enable  =&gt; true,
      require =&gt; [Package['gitlab-runner'], Exec["post-install"]]
    }
  
  }
  </code></pre>